Re: [PATCH 01/41] fs/adfs: inode: update timestamps to centisecond precision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 09, 2019 at 05:34:05PM +0300, Vyacheslav Dubeyko wrote:
> On Mon, 2019-12-09 at 14:03 +0000, Russell King - ARM Linux admin
> wrote:
> > > > 
> > On Mon, Dec 09, 2019 at 04:54:55PM +0300, Vyacheslav Dubeyko wrote:
> > > On Mon, 2019-12-09 at 11:08 +0000, Russell King wrote:
> 
> <snipped>
> 
> > > >  	sb->s_fs_info = asb;
> > > > +	sb->s_time_gran = 10000000;
> > > 
> > > I believe it's not easy to follow what this granularity means.
> > > Maybe,
> > > it makes sense to introduce some constant and to add some comment?
> > 
> > Or simply name it "s_time_gran_ns" so the units are in the name.
> > 
> 
> Sounds good. :) But why namely 10000000?

I don't know what you mean.

If you're asking, why "10000000", isn't it obvious if you read the
commit message?  adfs has "centi-second" granularity. s_time_gran
is in nanoseconds. There are 10000000 nanoseconds in a centisecond.

What do you expect?

#define ADFS_TIME_GRAN 10000000

	sb->s_time_gran = ADFS_TIME_GRAN;

?

How does that help - it just stupidly and needlessly obfuscates the
code.

The whole "use definitions for constants" is idiotic when a constant
is only used in one place - when it means you have to search through
more source code to find it's single definition. Sorry, I'm not
doing that and make readability *worse*.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux