mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
ovl: constant st_ino for non-samefs with xino
On 64bit systems, when overlay layers are not all on the same fs, but all inode numbers of underlying fs are not using the high bits, use the high bits to partition the overlay st_ino address space. The high bits hold the fsid (upper fsid is 0). This way overlay inode numbers are unique and all inodes use overlay st_dev. Inode numbers are also persistent for a given layer configuration. Currently, our only indication for available high ino bits is from a filesystem that supports file handles and uses the default encode_fh() operation, which encodes a 32bit inode number. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
5148626b80
commit
e487d889b7
5 changed files with 75 additions and 10 deletions
|
@ -55,10 +55,21 @@ struct super_block *ovl_same_sb(struct super_block *sb)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool ovl_can_decode_fh(struct super_block *sb)
|
||||
/*
|
||||
* Check if underlying fs supports file handles and try to determine encoding
|
||||
* type, in order to deduce maximum inode number used by fs.
|
||||
*
|
||||
* Return 0 if file handles are not supported.
|
||||
* Return 1 (FILEID_INO32_GEN) if fs uses the default 32bit inode encoding.
|
||||
* Return -1 if fs uses a non default encoding with unknown inode size.
|
||||
*/
|
||||
int ovl_can_decode_fh(struct super_block *sb)
|
||||
{
|
||||
return (sb->s_export_op && sb->s_export_op->fh_to_dentry &&
|
||||
!uuid_is_null(&sb->s_uuid));
|
||||
if (!sb->s_export_op || !sb->s_export_op->fh_to_dentry ||
|
||||
uuid_is_null(&sb->s_uuid))
|
||||
return 0;
|
||||
|
||||
return sb->s_export_op->encode_fh ? -1 : FILEID_INO32_GEN;
|
||||
}
|
||||
|
||||
struct dentry *ovl_indexdir(struct super_block *sb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue