aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-10-21 19:42:07 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 11:13:19 -0400
commit2e4c68e30352bc0018999c3e631e4363ce428424 (patch)
tree6b0acc452625dbcb9683bd7f1bb257a1f7338298 /fs
parent2596110a3994593f6aa3e2bb76345ad4791b1a14 (diff)
ext2: new export ops
Trivial switch over to the new generic helpers. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Neil Brown <neilb@suse.de> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext2/super.c34
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
314static struct dentry *ext2_get_dentry(struct super_block *sb, void *vobjp) 314static 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); 341static 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
348static 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 */
357static struct export_operations ext2_export_ops = { 360static 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
362static unsigned long get_sb_block(void **data) 366static unsigned long get_sb_block(void **data)