diff options
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r-- | fs/ext2/super.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 77bd5f9262f9..4a03d0c84df2 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -311,13 +311,10 @@ static const struct super_operations ext2_sops = { | |||
311 | #endif | 311 | #endif |
312 | }; | 312 | }; |
313 | 313 | ||
314 | static struct dentry *ext2_get_dentry(struct super_block *sb, void *vobjp) | 314 | static struct inode *ext2_nfs_get_inode(struct super_block *sb, |
315 | u64 ino, u32 generation) | ||
315 | { | 316 | { |
316 | __u32 *objp = vobjp; | ||
317 | unsigned long ino = objp[0]; | ||
318 | __u32 generation = objp[1]; | ||
319 | struct inode *inode; | 317 | struct inode *inode; |
320 | struct dentry *result; | ||
321 | 318 | ||
322 | if (ino < EXT2_FIRST_INO(sb) && ino != EXT2_ROOT_INO) | 319 | if (ino < EXT2_FIRST_INO(sb) && ino != EXT2_ROOT_INO) |
323 | return ERR_PTR(-ESTALE); | 320 | return ERR_PTR(-ESTALE); |
@@ -338,15 +335,21 @@ static struct dentry *ext2_get_dentry(struct super_block *sb, void *vobjp) | |||
338 | iput(inode); | 335 | iput(inode); |
339 | return ERR_PTR(-ESTALE); | 336 | return ERR_PTR(-ESTALE); |
340 | } | 337 | } |
341 | /* now to find a dentry. | 338 | return inode; |
342 | * If possible, get a well-connected one | 339 | } |
343 | */ | 340 | |
344 | result = d_alloc_anon(inode); | 341 | static struct dentry *ext2_fh_to_dentry(struct super_block *sb, struct fid *fid, |
345 | if (!result) { | 342 | int fh_len, int fh_type) |
346 | iput(inode); | 343 | { |
347 | return ERR_PTR(-ENOMEM); | 344 | return generic_fh_to_dentry(sb, fid, fh_len, fh_type, |
348 | } | 345 | ext2_nfs_get_inode); |
349 | return result; | 346 | } |
347 | |||
348 | static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid, | ||
349 | int fh_len, int fh_type) | ||
350 | { | ||
351 | return generic_fh_to_parent(sb, fid, fh_len, fh_type, | ||
352 | ext2_nfs_get_inode); | ||
350 | } | 353 | } |
351 | 354 | ||
352 | /* Yes, most of these are left as NULL!! | 355 | /* Yes, most of these are left as NULL!! |
@@ -355,8 +358,9 @@ static struct dentry *ext2_get_dentry(struct super_block *sb, void *vobjp) | |||
355 | * Currently only get_parent is required. | 358 | * Currently only get_parent is required. |
356 | */ | 359 | */ |
357 | static struct export_operations ext2_export_ops = { | 360 | static struct export_operations ext2_export_ops = { |
361 | .fh_to_dentry = ext2_fh_to_dentry, | ||
362 | .fh_to_parent = ext2_fh_to_parent, | ||
358 | .get_parent = ext2_get_parent, | 363 | .get_parent = ext2_get_parent, |
359 | .get_dentry = ext2_get_dentry, | ||
360 | }; | 364 | }; |
361 | 365 | ||
362 | static unsigned long get_sb_block(void **data) | 366 | static unsigned long get_sb_block(void **data) |