diff options
Diffstat (limited to 'fs/xfs/xfs_export.c')
-rw-r--r-- | fs/xfs/xfs_export.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c index 2d25d19c4ea1..42679223a0fd 100644 --- a/fs/xfs/xfs_export.c +++ b/fs/xfs/xfs_export.c | |||
@@ -52,19 +52,18 @@ static int xfs_fileid_length(int fileid_type) | |||
52 | 52 | ||
53 | STATIC int | 53 | STATIC int |
54 | xfs_fs_encode_fh( | 54 | xfs_fs_encode_fh( |
55 | struct dentry *dentry, | 55 | struct inode *inode, |
56 | __u32 *fh, | 56 | __u32 *fh, |
57 | int *max_len, | 57 | int *max_len, |
58 | int connectable) | 58 | struct inode *parent) |
59 | { | 59 | { |
60 | struct fid *fid = (struct fid *)fh; | 60 | struct fid *fid = (struct fid *)fh; |
61 | struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fh; | 61 | struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fh; |
62 | struct inode *inode = dentry->d_inode; | ||
63 | int fileid_type; | 62 | int fileid_type; |
64 | int len; | 63 | int len; |
65 | 64 | ||
66 | /* Directories don't need their parent encoded, they have ".." */ | 65 | /* Directories don't need their parent encoded, they have ".." */ |
67 | if (S_ISDIR(inode->i_mode) || !connectable) | 66 | if (!parent) |
68 | fileid_type = FILEID_INO32_GEN; | 67 | fileid_type = FILEID_INO32_GEN; |
69 | else | 68 | else |
70 | fileid_type = FILEID_INO32_GEN_PARENT; | 69 | fileid_type = FILEID_INO32_GEN_PARENT; |
@@ -96,20 +95,16 @@ xfs_fs_encode_fh( | |||
96 | 95 | ||
97 | switch (fileid_type) { | 96 | switch (fileid_type) { |
98 | case FILEID_INO32_GEN_PARENT: | 97 | case FILEID_INO32_GEN_PARENT: |
99 | spin_lock(&dentry->d_lock); | 98 | fid->i32.parent_ino = XFS_I(parent)->i_ino; |
100 | fid->i32.parent_ino = XFS_I(dentry->d_parent->d_inode)->i_ino; | 99 | fid->i32.parent_gen = parent->i_generation; |
101 | fid->i32.parent_gen = dentry->d_parent->d_inode->i_generation; | ||
102 | spin_unlock(&dentry->d_lock); | ||
103 | /*FALLTHRU*/ | 100 | /*FALLTHRU*/ |
104 | case FILEID_INO32_GEN: | 101 | case FILEID_INO32_GEN: |
105 | fid->i32.ino = XFS_I(inode)->i_ino; | 102 | fid->i32.ino = XFS_I(inode)->i_ino; |
106 | fid->i32.gen = inode->i_generation; | 103 | fid->i32.gen = inode->i_generation; |
107 | break; | 104 | break; |
108 | case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG: | 105 | case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG: |
109 | spin_lock(&dentry->d_lock); | 106 | fid64->parent_ino = XFS_I(parent)->i_ino; |
110 | fid64->parent_ino = XFS_I(dentry->d_parent->d_inode)->i_ino; | 107 | fid64->parent_gen = parent->i_generation; |
111 | fid64->parent_gen = dentry->d_parent->d_inode->i_generation; | ||
112 | spin_unlock(&dentry->d_lock); | ||
113 | /*FALLTHRU*/ | 108 | /*FALLTHRU*/ |
114 | case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG: | 109 | case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG: |
115 | fid64->ino = XFS_I(inode)->i_ino; | 110 | fid64->ino = XFS_I(inode)->i_ino; |