diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_export.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 80eb249f2fa0..b768ea910bbe 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "xfs_mount.h" | 25 | #include "xfs_mount.h" |
26 | #include "xfs_export.h" | 26 | #include "xfs_export.h" |
27 | 27 | ||
28 | STATIC struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, }; | ||
29 | |||
28 | /* | 30 | /* |
29 | * XFS encodes and decodes the fileid portion of NFS filehandles | 31 | * XFS encodes and decodes the fileid portion of NFS filehandles |
30 | * itself instead of letting the generic NFS code do it. This | 32 | * itself instead of letting the generic NFS code do it. This |
@@ -37,7 +39,7 @@ | |||
37 | */ | 39 | */ |
38 | 40 | ||
39 | STATIC struct dentry * | 41 | STATIC struct dentry * |
40 | linvfs_decode_fh( | 42 | xfs_fs_decode_fh( |
41 | struct super_block *sb, | 43 | struct super_block *sb, |
42 | __u32 *fh, | 44 | __u32 *fh, |
43 | int fh_len, | 45 | int fh_len, |
@@ -78,12 +80,12 @@ linvfs_decode_fh( | |||
78 | } | 80 | } |
79 | 81 | ||
80 | fh = (__u32 *)&ifid; | 82 | fh = (__u32 *)&ifid; |
81 | return find_exported_dentry(sb, fh, parent, acceptable, context); | 83 | return sb->s_export_op->find_exported_dentry(sb, fh, parent, acceptable, context); |
82 | } | 84 | } |
83 | 85 | ||
84 | 86 | ||
85 | STATIC int | 87 | STATIC int |
86 | linvfs_encode_fh( | 88 | xfs_fs_encode_fh( |
87 | struct dentry *dentry, | 89 | struct dentry *dentry, |
88 | __u32 *fh, | 90 | __u32 *fh, |
89 | int *max_len, | 91 | int *max_len, |
@@ -95,7 +97,7 @@ linvfs_encode_fh( | |||
95 | int len; | 97 | int len; |
96 | int is64 = 0; | 98 | int is64 = 0; |
97 | #if XFS_BIG_INUMS | 99 | #if XFS_BIG_INUMS |
98 | vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb); | 100 | vfs_t *vfs = vfs_from_sb(inode->i_sb); |
99 | 101 | ||
100 | if (!(vfs->vfs_flag & VFS_32BITINODES)) { | 102 | if (!(vfs->vfs_flag & VFS_32BITINODES)) { |
101 | /* filesystem may contain 64bit inode numbers */ | 103 | /* filesystem may contain 64bit inode numbers */ |
@@ -130,21 +132,21 @@ linvfs_encode_fh( | |||
130 | } | 132 | } |
131 | 133 | ||
132 | STATIC struct dentry * | 134 | STATIC struct dentry * |
133 | linvfs_get_dentry( | 135 | xfs_fs_get_dentry( |
134 | struct super_block *sb, | 136 | struct super_block *sb, |
135 | void *data) | 137 | void *data) |
136 | { | 138 | { |
137 | vnode_t *vp; | 139 | vnode_t *vp; |
138 | struct inode *inode; | 140 | struct inode *inode; |
139 | struct dentry *result; | 141 | struct dentry *result; |
140 | vfs_t *vfsp = LINVFS_GET_VFS(sb); | 142 | vfs_t *vfsp = vfs_from_sb(sb); |
141 | int error; | 143 | int error; |
142 | 144 | ||
143 | VFS_VGET(vfsp, &vp, (fid_t *)data, error); | 145 | VFS_VGET(vfsp, &vp, (fid_t *)data, error); |
144 | if (error || vp == NULL) | 146 | if (error || vp == NULL) |
145 | return ERR_PTR(-ESTALE) ; | 147 | return ERR_PTR(-ESTALE) ; |
146 | 148 | ||
147 | inode = LINVFS_GET_IP(vp); | 149 | inode = vn_to_inode(vp); |
148 | result = d_alloc_anon(inode); | 150 | result = d_alloc_anon(inode); |
149 | if (!result) { | 151 | if (!result) { |
150 | iput(inode); | 152 | iput(inode); |
@@ -154,25 +156,20 @@ linvfs_get_dentry( | |||
154 | } | 156 | } |
155 | 157 | ||
156 | STATIC struct dentry * | 158 | STATIC struct dentry * |
157 | linvfs_get_parent( | 159 | xfs_fs_get_parent( |
158 | struct dentry *child) | 160 | struct dentry *child) |
159 | { | 161 | { |
160 | int error; | 162 | int error; |
161 | vnode_t *vp, *cvp; | 163 | vnode_t *vp, *cvp; |
162 | struct dentry *parent; | 164 | struct dentry *parent; |
163 | struct dentry dotdot; | ||
164 | |||
165 | dotdot.d_name.name = ".."; | ||
166 | dotdot.d_name.len = 2; | ||
167 | dotdot.d_inode = NULL; | ||
168 | 165 | ||
169 | cvp = NULL; | 166 | cvp = NULL; |
170 | vp = LINVFS_GET_VP(child->d_inode); | 167 | vp = vn_from_inode(child->d_inode); |
171 | VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); | 168 | VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); |
172 | if (unlikely(error)) | 169 | if (unlikely(error)) |
173 | return ERR_PTR(-error); | 170 | return ERR_PTR(-error); |
174 | 171 | ||
175 | parent = d_alloc_anon(LINVFS_GET_IP(cvp)); | 172 | parent = d_alloc_anon(vn_to_inode(cvp)); |
176 | if (unlikely(!parent)) { | 173 | if (unlikely(!parent)) { |
177 | VN_RELE(cvp); | 174 | VN_RELE(cvp); |
178 | return ERR_PTR(-ENOMEM); | 175 | return ERR_PTR(-ENOMEM); |
@@ -180,9 +177,9 @@ linvfs_get_parent( | |||
180 | return parent; | 177 | return parent; |
181 | } | 178 | } |
182 | 179 | ||
183 | struct export_operations linvfs_export_ops = { | 180 | struct export_operations xfs_export_operations = { |
184 | .decode_fh = linvfs_decode_fh, | 181 | .decode_fh = xfs_fs_decode_fh, |
185 | .encode_fh = linvfs_encode_fh, | 182 | .encode_fh = xfs_fs_encode_fh, |
186 | .get_parent = linvfs_get_parent, | 183 | .get_parent = xfs_fs_get_parent, |
187 | .get_dentry = linvfs_get_dentry, | 184 | .get_dentry = xfs_fs_get_dentry, |
188 | }; | 185 | }; |