Re: How can I allocate few bytes to a file to store info about that file?

From: Andreas Dilger
Date: Wed Apr 28 2004 - 16:16:48 EST


On Apr 28, 2004 16:14 -0400, Vineet Joglekar wrote:
> I was going through the functions like generic_file_write,
> generic_file_direct_IO, generic_direct_IO and filemap_fdatasync. I was
> thinking about calling these functions or calling functions written on
> similar lines to add new few bytes to the file when the inode is created
> by "ext2_create()". Can any1 please tell me how to do this? What I mean
> is, I want to add few bytes to the file as soon as it is created. I want
> to store some information regarding the file in that area.

See sys_setxattr(). You need support for extended attributes in your kernel
and filesystem. This includes ext2/ext3 for 2.6, but only if you apply a
patch for 2.4 I believe.

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/