linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* inode generation numbers
@ 2003-09-09 19:08 Bernd Schubert
  2003-09-09 20:07 ` Andreas Dilger
  2003-09-10  0:04 ` Andries Brouwer
  0 siblings, 2 replies; 6+ messages in thread
From: Bernd Schubert @ 2003-09-09 19:08 UTC (permalink / raw)
  To: linux-kernel

Hello,

for a user space nfs-daemon it would be helpful to get the inode generation 
numbers. However it seems the fstat() from the glibc doesn't support this, 
but refering to some google search fstat() from some (not all) other unixes 
does.
Does anyone know how to read those numbers from userspace with linux?

Thanks,
	Bernd


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

* Re: inode generation numbers
  2003-09-09 19:08 inode generation numbers Bernd Schubert
@ 2003-09-09 20:07 ` Andreas Dilger
  2003-09-09 22:53   ` Bernd Schubert
  2003-09-10  8:18   ` Nikita Danilov
  2003-09-10  0:04 ` Andries Brouwer
  1 sibling, 2 replies; 6+ messages in thread
From: Andreas Dilger @ 2003-09-09 20:07 UTC (permalink / raw)
  To: Bernd Schubert; +Cc: linux-kernel

On Sep 09, 2003  21:08 +0200, Bernd Schubert wrote:
> for a user space nfs-daemon it would be helpful to get the inode generation 
> numbers. However it seems the fstat() from the glibc doesn't support this, 
> but refering to some google search fstat() from some (not all) other unixes 
> does.
> Does anyone know how to read those numbers from userspace with linux?

For ext2/ext3 filesystems you can use EXT2_GET_VERSION ioctl for this.
Maybe reiserfs as well.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


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

* Re: inode generation numbers
  2003-09-09 20:07 ` Andreas Dilger
@ 2003-09-09 22:53   ` Bernd Schubert
  2003-09-11  7:03     ` Oleg Drokin
  2003-09-10  8:18   ` Nikita Danilov
  1 sibling, 1 reply; 6+ messages in thread
From: Bernd Schubert @ 2003-09-09 22:53 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: linux-kernel, reiserfs-list

On Tuesday 09 September 2003 22:07, Andreas Dilger wrote:
> On Sep 09, 2003  21:08 +0200, Bernd Schubert wrote:
> > for a user space nfs-daemon it would be helpful to get the inode
> > generation numbers. However it seems the fstat() from the glibc doesn't
> > support this, but refering to some google search fstat() from some (not
> > all) other unixes does.
> > Does anyone know how to read those numbers from userspace with linux?
>
> For ext2/ext3 filesystems you can use EXT2_GET_VERSION ioctl for this.

regarding to fs/ext2/ioctl.c it should be EXT2_IOC_GETVERSION, shouldn't it?

> Maybe reiserfs as well.
>

Hello,

thanks a lot, it seems to work pretty well.
Since I have never used the ioctl() call before I only want to be sure I don't 
do something wrong,  I think this is correct, isn't it?

int ret, igen;
ret = ioctl(fd, EXT2_IOC_GETVERSION, &igen);


It also works for reiserfs-partitions with the very same call, @reiserfs-team, 
this won't change in the future, will it?


Cheers,
	Bernd


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

* Re: inode generation numbers
  2003-09-09 19:08 inode generation numbers Bernd Schubert
  2003-09-09 20:07 ` Andreas Dilger
@ 2003-09-10  0:04 ` Andries Brouwer
  1 sibling, 0 replies; 6+ messages in thread
From: Andries Brouwer @ 2003-09-10  0:04 UTC (permalink / raw)
  To: Bernd Schubert; +Cc: linux-kernel

On Tue, Sep 09, 2003 at 09:08:37PM +0200, Bernd Schubert wrote:

> for a user space nfs-daemon it would be helpful to get the inode generation 
> numbers. However it seems the fstat() from the glibc doesn't support this, 
> but refering to some google search fstat() from some (not all) other unixes 
> does.
> Does anyone know how to read those numbers from userspace with linux?

For ext2:
The i_generation field of a file can be read and set using
the EXT2_IOC_GETVERSION and EXT2_IOC_SETVERSION ioctls.


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

* Re: inode generation numbers
  2003-09-09 20:07 ` Andreas Dilger
  2003-09-09 22:53   ` Bernd Schubert
@ 2003-09-10  8:18   ` Nikita Danilov
  1 sibling, 0 replies; 6+ messages in thread
From: Nikita Danilov @ 2003-09-10  8:18 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: Bernd Schubert, linux-kernel

Andreas Dilger writes:
 > On Sep 09, 2003  21:08 +0200, Bernd Schubert wrote:
 > > for a user space nfs-daemon it would be helpful to get the inode generation 
 > > numbers. However it seems the fstat() from the glibc doesn't support this, 
 > > but refering to some google search fstat() from some (not all) other unixes 
 > > does.
 > > Does anyone know how to read those numbers from userspace with linux?
 > 
 > For ext2/ext3 filesystems you can use EXT2_GET_VERSION ioctl for this.
 > Maybe reiserfs as well.

yes.

 > 
 > Cheers, Andreas

Nikita.


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

* Re: inode generation numbers
  2003-09-09 22:53   ` Bernd Schubert
@ 2003-09-11  7:03     ` Oleg Drokin
  0 siblings, 0 replies; 6+ messages in thread
From: Oleg Drokin @ 2003-09-11  7:03 UTC (permalink / raw)
  To: Bernd Schubert; +Cc: Andreas Dilger, linux-kernel, reiserfs-list

Hello!

On Wed, Sep 10, 2003 at 12:53:22AM +0200, Bernd Schubert wrote:

> It also works for reiserfs-partitions with the very same call, @reiserfs-team, 
> this won't change in the future, will it?

Yes, it is in there just to be compatible with ext2.

Be warned that on v3.5 filesystems this generation stuff is weakly implemented
and defaults to object id of parent directory.

Bye,
    Oleg

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

end of thread, other threads:[~2003-09-11  7:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-09 19:08 inode generation numbers Bernd Schubert
2003-09-09 20:07 ` Andreas Dilger
2003-09-09 22:53   ` Bernd Schubert
2003-09-11  7:03     ` Oleg Drokin
2003-09-10  8:18   ` Nikita Danilov
2003-09-10  0:04 ` Andries Brouwer

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).