Extending struct file_id

Tim Prouty tprouty at samba.org
Tue Feb 17 19:05:48 MST 2009


On Feb 16, 2009, at 3:02 PM, Tim Prouty wrote:

> 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


I have finished making the changes, and have pushed them here for  
comments:

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

I would like to push this later this week if there are no objections.

-Tim


More information about the samba-technical mailing list