diff options
Diffstat (limited to 'fs/ntfs/namei.c')
-rw-r--r-- | fs/ntfs/namei.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index 7c7e13b43b2e..d261e25bd9ba 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c | |||
@@ -380,7 +380,7 @@ struct inode_operations ntfs_dir_inode_ops = { | |||
380 | * Return the dentry of the parent directory on success or the error code on | 380 | * Return the dentry of the parent directory on success or the error code on |
381 | * error (IS_ERR() is true). | 381 | * error (IS_ERR() is true). |
382 | */ | 382 | */ |
383 | struct dentry *ntfs_get_parent(struct dentry *child_dent) | 383 | static struct dentry *ntfs_get_parent(struct dentry *child_dent) |
384 | { | 384 | { |
385 | struct inode *vi = child_dent->d_inode; | 385 | struct inode *vi = child_dent->d_inode; |
386 | ntfs_inode *ni = NTFS_I(vi); | 386 | ntfs_inode *ni = NTFS_I(vi); |
@@ -465,7 +465,7 @@ try_next: | |||
465 | * | 465 | * |
466 | * Return the dentry on success or the error code on error (IS_ERR() is true). | 466 | * Return the dentry on success or the error code on error (IS_ERR() is true). |
467 | */ | 467 | */ |
468 | struct dentry *ntfs_get_dentry(struct super_block *sb, void *fh) | 468 | static struct dentry *ntfs_get_dentry(struct super_block *sb, void *fh) |
469 | { | 469 | { |
470 | struct inode *vi; | 470 | struct inode *vi; |
471 | struct dentry *dent; | 471 | struct dentry *dent; |
@@ -496,3 +496,30 @@ struct dentry *ntfs_get_dentry(struct super_block *sb, void *fh) | |||
496 | ntfs_debug("Done for inode 0x%lx, generation 0x%x.", ino, gen); | 496 | ntfs_debug("Done for inode 0x%lx, generation 0x%x.", ino, gen); |
497 | return dent; | 497 | return dent; |
498 | } | 498 | } |
499 | |||
500 | /** | ||
501 | * Export operations allowing NFS exporting of mounted NTFS partitions. | ||
502 | * | ||
503 | * We use the default ->decode_fh() and ->encode_fh() for now. Note that they | ||
504 | * use 32 bits to store the inode number which is an unsigned long so on 64-bit | ||
505 | * architectures is usually 64 bits so it would all fail horribly on huge | ||
506 | * volumes. I guess we need to define our own encode and decode fh functions | ||
507 | * that store 64-bit inode numbers at some point but for now we will ignore the | ||
508 | * problem... | ||
509 | * | ||
510 | * We also use the default ->get_name() helper (used by ->decode_fh() via | ||
511 | * fs/exportfs/expfs.c::find_exported_dentry()) as that is completely fs | ||
512 | * independent. | ||
513 | * | ||
514 | * The default ->get_parent() just returns -EACCES so we have to provide our | ||
515 | * own and the default ->get_dentry() is incompatible with NTFS due to not | ||
516 | * allowing the inode number 0 which is used in NTFS for the system file $MFT | ||
517 | * and due to using iget() whereas NTFS needs ntfs_iget(). | ||
518 | */ | ||
519 | struct export_operations ntfs_export_ops = { | ||
520 | .get_parent = ntfs_get_parent, /* Find the parent of a given | ||
521 | directory. */ | ||
522 | .get_dentry = ntfs_get_dentry, /* Find a dentry for the inode | ||
523 | given a file handle | ||
524 | sub-fragment. */ | ||
525 | }; | ||