From: "Namjae Jeon" <namjae.jeon@samsung.com>
To: "'Arnd Bergmann'" <arnd@arndb.de>
Cc: <linux-kernel@vger.kernel.org>,
"'Linux FS-devel Mailing List'" <linux-fsdevel@vger.kernel.org>,
"'gregkh'" <gregkh@linuxfoundation.org>,
"'Valdis Kletnieks'" <valdis.kletnieks@vt.edu>,
"'Christoph Hellwig'" <hch@lst.de>, <linkinjeon@gmail.com>,
<Markus.Elfring@web.de>, <sj1557.seo@samsung.com>
Subject: RE: [PATCH v2 09/13] exfat: add misc operations
Date: Fri, 10 Jan 2020 08:35:34 +0900 [thread overview]
Message-ID: <001f01d5c745$7d0a3730$771ea590$@samsung.com> (raw)
In-Reply-To: <CAK8P3a2_-xkiV0EeemKDNgsU+Xv+fROmsTUa6j0hBaQSCPKMag@mail.gmail.com>
> On Tue, Nov 19, 2019 at 8:16 AM Namjae Jeon <namjae.jeon@samsung.com>
> wrote:
>
> > +/* <linux/time.h> externs sys_tz
> > + * extern struct timezone sys_tz;
> > + */
> > +#define UNIX_SECS_1980 315532800L
> > +
> > +#if BITS_PER_LONG == 64
> > +#define UNIX_SECS_2108 4354819200L
> > +#endif
> > +
> > +/* days between 1970/01/01 and 1980/01/01 (2 leap days) */
> > +#define DAYS_DELTA_DECADE (365 * 10 + 2)
> > +/* 120 (2100 - 1980) isn't leap year */
> > +#define NO_LEAP_YEAR_2100 (120)
> > +#define IS_LEAP_YEAR(y) (!((y) & 0x3) && (y) != NO_LEAP_YEAR_2100)
> > +
> > +#define SECS_PER_MIN (60)
> > +#define SECS_PER_HOUR (60 * SECS_PER_MIN)
> > +#define SECS_PER_DAY (24 * SECS_PER_HOUR)
>
> None of this code should exist, just use time64_to_tm() and tm_to_time64()
Okay, Will use them.
>
> > + if (!sbi->options.tz_utc)
> > + ts->tv_sec += sys_tz.tz_minuteswest * SECS_PER_MIN;
>
> I would make tz_utc the default here. Not sure what windows uses or what
> the specification says, but sys_tz is a rather unreliable interface, and
> it's better to not use that at all if it can be avoided.
>
> It may be useful to have a mount option for the time zone offset instead.
Okay, Will add a time_zone_offset mount option.
>
> > + ts->tv_nsec = 0;
> > +}
> > +
> > +/* Convert linear UNIX date to a FAT time/date pair. */ void
> > +exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec64 *ts,
> > + struct exfat_date_time *tp)
>
> This is basically time64_to_tm(), just be careful about to check whether
> months are counted from 1 or 0.
Okay.
Thanks for your review!
>
> Arnd
next prev parent reply other threads:[~2020-01-09 23:35 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20191119071401epcas1p4a42c781276e89928a24d53379fe13d64@epcas1p4.samsung.com>
2019-11-19 7:10 ` [PATCH v2 00/13] add the latest exfat driver Namjae Jeon
2019-11-19 7:10 ` [PATCH v2 01/13] exfat: add in-memory and on-disk structures and headers Namjae Jeon
2019-11-20 9:22 ` Nikolay Borisov
2019-11-19 7:10 ` [PATCH v2 02/13] exfat: add super block operations Namjae Jeon
2019-11-19 8:56 ` Daniel Wagner
2019-11-19 9:22 ` Namjae Jeon
2019-11-19 17:17 ` Christoph Hellwig
2019-11-20 4:33 ` Namjae Jeon
2019-11-19 7:10 ` [PATCH v2 03/13] exfat: add inode operations Namjae Jeon
2019-11-19 7:10 ` [PATCH v2 04/13] exfat: add directory operations Namjae Jeon
2019-11-19 7:10 ` [PATCH v2 05/13] exfat: add file operations Namjae Jeon
2019-11-20 9:14 ` Nikolay Borisov
2019-11-21 1:42 ` Namjae Jeon
2019-11-21 3:18 ` Valdis Klētnieks
2019-11-21 3:39 ` Namjae Jeon
2019-11-19 7:11 ` [PATCH v2 06/13] exfat: add exfat entry operations Namjae Jeon
2019-11-20 9:19 ` Nikolay Borisov
2019-11-19 7:11 ` [PATCH v2 07/13] exfat: add bitmap operations Namjae Jeon
2019-11-20 9:24 ` Nikolay Borisov
2019-11-19 7:11 ` [PATCH v2 08/13] exfat: add exfat cache Namjae Jeon
2019-11-19 7:11 ` [PATCH v2 09/13] exfat: add misc operations Namjae Jeon
2020-01-08 19:53 ` Arnd Bergmann
2020-01-09 23:35 ` Namjae Jeon [this message]
2019-11-19 7:11 ` [PATCH v2 10/13] exfat: add nls operations Namjae Jeon
2019-11-19 7:11 ` [PATCH v2 11/13] exfat: add Kconfig and Makefile Namjae Jeon
2019-11-19 7:11 ` [PATCH v2 12/13] exfat: add exfat in fs/Kconfig and fs/Makefile Namjae Jeon
2019-11-19 7:11 ` [PATCH v2 13/13] MAINTAINERS: add exfat filesystem Namjae Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001f01d5c745$7d0a3730$771ea590$@samsung.com' \
--to=namjae.jeon@samsung.com \
--cc=Markus.Elfring@web.de \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=linkinjeon@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sj1557.seo@samsung.com \
--cc=valdis.kletnieks@vt.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.