Extending struct file_id

Tim Prouty tprouty at samba.org
Mon Feb 16 16:02:20 MST 2009


The struct file_id is used to uniquely identify a file, and currently  
looks like this:

struct file_id {
	uint64_t devid;
	uint64_t inode;
};

To support the copy-on-write snapshots in our file system/kernel,  
files are uniquely identified by a dev/inode/snapid triple.  I would  
like to extend the file_id struct to add an additional generic  
unit64_t field: extid.  In the short term this would allow us to use  
the field to enable snapshot support, but would also pave the way for  
any other system that wish to extend their inodes.

I looked into making the new field a private_data void * that is  
hidden under the vfs, but there are a few problems with that.  The  
biggest problem I ran into is that there are many places that call  
into file_id.c utility functions that don't have a conn struct  
available to pass into the vfs layer.  The second issue is that there  
is an smb_share_modes library that doesn't have the ability to call  
through the vfs.

I also considered using an #ifdef to conditionally add the extid field  
to the file_id struct.  In addition to adding complexity to the code,  
there is still the smb_share_modes library problem with having a  
configure-checked'd ifdef.

There are still a few more fixes I'm working on, such as changing the  
getwd_cache to use a file_id, but for now I'm looking to get some  
feedback on the changes so far:

http://git.samba.org/?p=tprouty/samba.git;a=shortlog;h=refs/heads/extend_file_id


Thanks!

-Tim


More information about the samba-technical mailing list