2019-09-09 16:33:01

by Valentin Vidić

[permalink] [raw]
Subject: [PATCH v2 2/3] staging: exfat: drop unused field access_time_ms

Not used in the exfat-fuse implementation and spec defines
this position should hold the value for CreateUtcOffset.

Signed-off-by: Valentin Vidic <[email protected]>
---
drivers/staging/exfat/exfat.h | 3 +--
drivers/staging/exfat/exfat_core.c | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 58e1e889779f..6491ea034928 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -444,8 +444,7 @@ struct file_dentry_t {
u8 access_date[2];
u8 create_time_ms;
u8 modify_time_ms;
- u8 access_time_ms;
- u8 reserved2[9];
+ u8 reserved2[10];
};

/* MS-DOS EXFAT stream extension directory entry (32 bytes) */
diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c
index 995358cc7c79..8476eeedba83 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -1456,7 +1456,6 @@ void init_file_entry(struct file_dentry_t *ep, u32 type)
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_ACCESS);
ep->create_time_ms = 0;
ep->modify_time_ms = 0;
- ep->access_time_ms = 0;
}

void init_strm_entry(struct strm_dentry_t *ep, u8 flags, u32 start_clu, u64 size)
--
2.20.1


2019-09-09 17:22:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] staging: exfat: drop unused field access_time_ms

On Sun, Sep 08, 2019 at 04:10:14PM +0000, Valentin Vidic wrote:
> Not used in the exfat-fuse implementation and spec defines
> this position should hold the value for CreateUtcOffset.

Then why not just put CreateUtcOffset in here instaed of deleting it?

I would much rather the fields match the spec in the structures for lots
of good reasons, instead of having loads of "reserved[]" variables.

thanks,

greg k-h

2019-09-09 18:38:24

by Valentin Vidić

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] staging: exfat: drop unused field access_time_ms

On Sun, Sep 08, 2019 at 08:19:21PM -0400, Valdis Klētnieks wrote:
> In that case, rather than removing it, shouldn't we be *adding*
> code to properly set it instead?

Right, setting the UtcOffset fields to 0 is the first step marking
them as invalid for now. This is also why access_time_ms did not do
any harm here - it was always set to 0 too.

7.4.10.2 OffsetValid Field

The OffsetValid field shall describe whether the contents of the OffsetFromUtc
field are valid or not, as follows:

0, which means the contents of the OffsetFromUtc field are invalid
and shall be 00h

1, which means the contents of the OffsetFromUtc field are valid

--
Valentin

2019-09-09 19:41:11

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] staging: exfat: drop unused field access_time_ms

On Sun, 08 Sep 2019 16:10:14 -0000, Valentin Vidic said:
> Not used in the exfat-fuse implementation and spec defines
> this position should hold the value for CreateUtcOffset.

In that case, rather than removing it, shouldn't we be *adding*
code to properly set it instead?


Attachments:
(No filename) (849.00 B)