Commit 7a9dadef authored by Amir Goldstein's avatar Amir Goldstein Committed by Miklos Szeredi

ovl: hash non-indexed dir by upper inode for NFS export

Non-indexed upper dirs are encoded as upper file handles. When NFS export
is enabled, hash non-indexed directory inodes by upper inode, so we can
find them in inode cache using the decoded upper inode.

When NFS export is disabled, directories are not indexed on copy up, so
hash non-indexed directory inodes by origin inode, the same hash key
that is used before copy up.
Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 98892516
...@@ -665,6 +665,7 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry, ...@@ -665,6 +665,7 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry,
struct dentry *lowerdentry, struct dentry *index, struct dentry *lowerdentry, struct dentry *index,
unsigned int numlower) unsigned int numlower)
{ {
struct ovl_fs *ofs = sb->s_fs_info;
struct inode *realinode = upperdentry ? d_inode(upperdentry) : NULL; struct inode *realinode = upperdentry ? d_inode(upperdentry) : NULL;
struct inode *inode; struct inode *inode;
/* Already indexed or could be indexed on copy up? */ /* Already indexed or could be indexed on copy up? */
...@@ -684,9 +685,10 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry, ...@@ -684,9 +685,10 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry,
* Hash non-dir that is or could be indexed by origin inode. * Hash non-dir that is or could be indexed by origin inode.
* Hash dir that is or could be merged by origin inode. * Hash dir that is or could be merged by origin inode.
* Hash pure upper and non-indexed non-dir by upper inode. * Hash pure upper and non-indexed non-dir by upper inode.
* Hash non-indexed dir by upper inode for NFS export.
*/ */
is_dir = S_ISDIR(realinode->i_mode); is_dir = S_ISDIR(realinode->i_mode);
if (is_dir) if (is_dir && (indexed || !sb->s_export_op || !ofs->upper_mnt))
origin = lowerdentry; origin = lowerdentry;
if (upperdentry || origin) { if (upperdentry || origin) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment