|
|
Subject: Re: inode allocation - msg#00021
List: file-systems.ext2.devel
On Mon, Oct 27, 2003 at 07:43:26PM +0000, Drew P. Vogel wrote:
> Currently inodes are allocated in a way that a file created will be
> assigned the inode of the last file removed, assuming no other files have
> been created since the file was removed.
No, not necessarily. The first free inode in the block group of the
containing directory is used. This might or might not be the inode of
the last file removed.
> In shell scrict terms, after running this:
>
> touch file
> a=`stat -c %i file`
> rm file
> touch file
> b=`stat -c %i file`
>
> $a eq $b. This makes it difficult to determine if those two files are
> different. Is this goal of the design or just a side-effect?
It's not a goal, but inode numbers were not intended to be used to
assure file uniqueness. Exactly what is the high-level problem you
are trying to solve?
- Ted
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: inode allocation
On Oct 27, 2003 20:43 +0000, Drew P. Vogel wrote:
> Given two lists of files I'm trying to determine which files are new,
> removed, or modified. On ext2 there isn't a straight-foward way to
> determine whether a file is modified or removed and recreated if the
> removal and creation happens between the times the two lists are created.
But at the same time you can't easily determine just from the name and the
inode number whether the files have been modified either. You need to
compare file size, mtime, ctime, and then a checksum and/or byte-by-byte
comparison (cmp, diff, etc).
You could just use something like rsync and save yourself the effort.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
Next Message by Date:
click to view message preview
Re: inode allocation
On Mon, 27 Oct 2003, Theodore Ts'o wrote:
>It's not a goal, but inode numbers were not intended to be used to
>assure file uniqueness.
Oh, ok. I guess I misunderstood the book I was reading. Thanks.
Regards,
Drew Vogel
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
Previous Message by Thread:
click to view message preview
Re: inode allocation
On Oct 27, 2003 20:43 +0000, Drew P. Vogel wrote:
> Given two lists of files I'm trying to determine which files are new,
> removed, or modified. On ext2 there isn't a straight-foward way to
> determine whether a file is modified or removed and recreated if the
> removal and creation happens between the times the two lists are created.
But at the same time you can't easily determine just from the name and the
inode number whether the files have been modified either. You need to
compare file size, mtime, ctime, and then a checksum and/or byte-by-byte
comparison (cmp, diff, etc).
You could just use something like rsync and save yourself the effort.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
Next Message by Thread:
click to view message preview
Re: inode allocation
On Mon, 27 Oct 2003, Theodore Ts'o wrote:
>It's not a goal, but inode numbers were not intended to be used to
>assure file uniqueness.
Oh, ok. I guess I misunderstood the book I was reading. Thanks.
Regards,
Drew Vogel
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
|
|