linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [patch 3/3] i_version update for ext4: user interface
@ 2007-01-23 17:24 Cordenner jean noel
  2007-01-23 18:52 ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Cordenner jean noel @ 2007-01-23 17:24 UTC (permalink / raw)
  To: linux-ext4; +Cc: nfsv4

This patch adds a  ``st_i_version'' field in the stat
structure, and modifies the stat(2) syscall accordingly. Currently the
change is only visible on i386 and x86_64 archs.



Signed-off-by: Jean Noel Cordenner <jean-noel.cordenner@bull.net>

Index: linux-2.6.20-rc5/fs/stat.c
===================================================================
--- linux-2.6.20-rc5.orig/fs/stat.c     2007-01-19 16:59:15.000000000 +0100
+++ linux-2.6.20-rc5/fs/stat.c  2007-01-23 16:21:17.000000000 +0100
@@ -31,6 +31,7 @@
         stat->atime = inode->i_atime;
         stat->mtime = inode->i_mtime;
         stat->ctime = inode->i_ctime;
+       stat->i_version = inode->i_version;
         stat->size = i_size_read(inode);
         stat->blocks = inode->i_blocks;
         stat->blksize = (1 << inode->i_blkbits);
@@ -226,6 +227,7 @@
         tmp.st_atime = stat->atime.tv_sec;
         tmp.st_mtime = stat->mtime.tv_sec;
         tmp.st_ctime = stat->ctime.tv_sec;
+       tmp.st_i_version = stat->i_version;
  #ifdef STAT_HAVE_NSEC
         tmp.st_atime_nsec = stat->atime.tv_nsec;
         tmp.st_mtime_nsec = stat->mtime.tv_nsec;
@@ -359,6 +361,7 @@
         tmp.st_mtime_nsec = stat->mtime.tv_nsec;
         tmp.st_ctime = stat->ctime.tv_sec;
         tmp.st_ctime_nsec = stat->ctime.tv_nsec;
+       tmp.st_i_version = stat->i_version;
         tmp.st_size = stat->size;
         tmp.st_blocks = stat->blocks;
         tmp.st_blksize = stat->blksize;
Index: linux-2.6.20-rc5/include/linux/stat.h
===================================================================
--- linux-2.6.20-rc5.orig/include/linux/stat.h  2006-11-29 
22:57:37.000000000 +0100
+++ linux-2.6.20-rc5/include/linux/stat.h       2007-01-23 
16:22:18.000000000 +0100
@@ -68,6 +68,7 @@
         struct timespec  atime;
         struct timespec mtime;
         struct timespec ctime;
+       unsigned long   i_version;
         unsigned long   blksize;
         unsigned long long      blocks;
  };
Index: linux-2.6.20-rc5/include/asm-i386/stat.h
===================================================================
--- linux-2.6.20-rc5.orig/include/asm-i386/stat.h       2006-11-29 
22:57:37.000000000 +0100
+++ linux-2.6.20-rc5/include/asm-i386/stat.h    2007-01-23 
17:48:36.000000000 +0100
@@ -32,7 +32,7 @@
         unsigned long  st_mtime_nsec;
         unsigned long  st_ctime;
         unsigned long  st_ctime_nsec;
-       unsigned long  __unused4;
+       unsigned long  st_i_version;
         unsigned long  __unused5;
  };

@@ -41,7 +41,7 @@
   */
  struct stat64 {
         unsigned long long      st_dev;
-       unsigned char   __pad0[4];
+       unsigned int    st_i_version;

  #define STAT64_HAS_BROKEN_ST_INO       1
         unsigned long   __st_ino;
Index: linux-2.6.20-rc5/include/asm-x86_64/stat.h
===================================================================
--- linux-2.6.20-rc5.orig/include/asm-x86_64/stat.h     2006-11-29 
22:57:37.000000000 +0100
+++ linux-2.6.20-rc5/include/asm-x86_64/stat.h  2007-01-23 
17:57:03.000000000 +0100
@@ -23,7 +23,8 @@
         unsigned long   st_mtime_nsec;
         unsigned long   st_ctime;
         unsigned long   st_ctime_nsec;
-       long            __unused[3];
+       unsigned long   st_i_version;
+       long            __unused[2];
  };

  /* For 32bit emulation */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] [patch 3/3] i_version update for ext4: user interface
  2007-01-23 17:24 [RFC] [patch 3/3] i_version update for ext4: user interface Cordenner jean noel
@ 2007-01-23 18:52 ` Andreas Dilger
  2007-01-24 18:14   ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Dilger @ 2007-01-23 18:52 UTC (permalink / raw)
  To: Cordenner jean noel; +Cc: linux-ext4, nfsv4

On Jan 23, 2007  18:24 +0100, Cordenner jean noel wrote:
> This patch adds a  ``st_i_version'' field in the stat
> structure, and modifies the stat(2) syscall accordingly. Currently the
> change is only visible on i386 and x86_64 archs.

What is the need for exporting i_version to userspace?

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] [patch 3/3] i_version update for ext4: user interface
  2007-01-23 18:52 ` Andreas Dilger
@ 2007-01-24 18:14   ` J. Bruce Fields
  2007-01-24 18:16     ` Peter Staubach
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2007-01-24 18:14 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: Cordenner jean noel, linux-ext4, nfsv4

On Tue, Jan 23, 2007 at 11:52:08AM -0700, Andreas Dilger wrote:
> On Jan 23, 2007  18:24 +0100, Cordenner jean noel wrote:
> > This patch adds a  ``st_i_version'' field in the stat
> > structure, and modifies the stat(2) syscall accordingly. Currently the
> > change is only visible on i386 and x86_64 archs.
> 
> What is the need for exporting i_version to userspace?

Maybe none, but it seems potentially really useful to me; in practice
aren't most uses of mtime/ctime exactly in order to find out if the file
has changed recently?

Who else is asking for finer time resolutions?  Is it because they need
the precision (or the inter-file comparison) or because they need to
know whether a file has changed?

Isn't anybody that currently maintains some cached information about a
filesystem currently living with the same races as NFS?

--b.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] [patch 3/3] i_version update for ext4: user interface
  2007-01-24 18:14   ` J. Bruce Fields
@ 2007-01-24 18:16     ` Peter Staubach
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Staubach @ 2007-01-24 18:16 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Andreas Dilger, linux-ext4, nfsv4, Cordenner jean noel

J. Bruce Fields wrote:
> On Tue, Jan 23, 2007 at 11:52:08AM -0700, Andreas Dilger wrote:
>   
>> On Jan 23, 2007  18:24 +0100, Cordenner jean noel wrote:
>>     
>>> This patch adds a  ``st_i_version'' field in the stat
>>> structure, and modifies the stat(2) syscall accordingly. Currently the
>>> change is only visible on i386 and x86_64 archs.
>>>       
>> What is the need for exporting i_version to userspace?
>>     
>
> Maybe none, but it seems potentially really useful to me; in practice
> aren't most uses of mtime/ctime exactly in order to find out if the file
> has changed recently?
>
> Who else is asking for finer time resolutions?  Is it because they need
> the precision (or the inter-file comparison) or because they need to
> know whether a file has changed?
>
> Isn't anybody that currently maintains some cached information about a
> filesystem currently living with the same races as NFS?

Doesn't the BSD stat struct have a field like this?  If so, perhaps
they can remember why it was deemed to be interesting?

    Thanx...

       ps

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-24 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-23 17:24 [RFC] [patch 3/3] i_version update for ext4: user interface Cordenner jean noel
2007-01-23 18:52 ` Andreas Dilger
2007-01-24 18:14   ` J. Bruce Fields
2007-01-24 18:16     ` Peter Staubach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).