2010/12/2 David Pottage <da...@electric-spoon.com>: > > Therefore I think it is a bad idea if potentially different files on btrfs > can have the same inode number. It will break all sorts of tools. > > Instead of maintaining a big complicated reference count of used inode > numbers, could btrfs use bit masks to create a the userland visible inode > number from the subvolume id and the real internal inode number. Something > like: > > userland_inode = ( volume_id << 48 ) & internal_inode; > > Please forgive me if this is impossible, or if that C snippet is > syntactically incorrect. I am not a filesystem or kernel developer, and I > have not coded in C for many years. > > -- > David Pottage >
Expanding on the idea: what about a pool of IDs for subvolumes and inode numbers inside a subvolume having the subvolume ID as a prefix? It gives each inode a unique number, doesn't require cheating the userland and is less costly than keeping reference count for each inode. The obvious downside that I can see is limitation on number of subvolumes that it would be possible to create. It also lowers the maximum number of inodes in a filesystem (because of bits taken up by subvolume ID). I expect there are also less-than obvious downsides. Just an idea by a kernel and FS ignorant. -- Paweł Brodacki -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html