aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-03-03 08:44:15 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 06:13:56 -0400
commit413826868fb49d200b741bcaeaf58ea5c5e45321 (patch)
treea106b6e0bae52a68a0b824f1999ab694d894a1f2 /fs/ntfs
parent8907547d4b099e67762ea4891c127ea1f6dd1cb7 (diff)
NTFS: Make fs/ntfs/namei.c::ntfs_get_{parent,dentry} static and move the
definition of ntfs_export_ops from fs/ntfs/super.c to namei.c. Also, declare ntfs_export_ops in fs/ntfs/ntfs.h. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs')
-rw-r--r--fs/ntfs/ChangeLog3
-rw-r--r--fs/ntfs/namei.c31
-rw-r--r--fs/ntfs/ntfs.h2
-rw-r--r--fs/ntfs/super.c34
4 files changed, 34 insertions, 36 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index bfd86c5cc480..cf21e0571b68 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -81,6 +81,9 @@ ToDo/Notes:
81 mft record for resident attributes (fs/ntfs/inode.c). 81 mft record for resident attributes (fs/ntfs/inode.c).
82 - Small readability cleanup to use "a" instead of "ctx->attr" 82 - Small readability cleanup to use "a" instead of "ctx->attr"
83 everywhere (fs/ntfs/inode.c). 83 everywhere (fs/ntfs/inode.c).
84 - Make fs/ntfs/namei.c::ntfs_get_{parent,dentry} static and move the
85 definition of ntfs_export_ops from fs/ntfs/super.c to namei.c. Also,
86 declare ntfs_export_ops in fs/ntfs/ntfs.h.
84 87
852.1.22 - Many bug and race fixes and error handling improvements. 882.1.22 - Many bug and race fixes and error handling improvements.
86 89
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 */
383struct dentry *ntfs_get_parent(struct dentry *child_dent) 383static 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 */
468struct dentry *ntfs_get_dentry(struct super_block *sb, void *fh) 468static 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 */
519struct 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};
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
index 720ffb71bab8..a0bf706797bb 100644
--- a/fs/ntfs/ntfs.h
+++ b/fs/ntfs/ntfs.h
@@ -65,6 +65,8 @@ extern struct inode_operations ntfs_dir_inode_ops;
65extern struct file_operations ntfs_empty_file_ops; 65extern struct file_operations ntfs_empty_file_ops;
66extern struct inode_operations ntfs_empty_inode_ops; 66extern struct inode_operations ntfs_empty_inode_ops;
67 67
68extern struct export_operations ntfs_export_ops;
69
68/** 70/**
69 * NTFS_SB - return the ntfs volume given a vfs super block 71 * NTFS_SB - return the ntfs volume given a vfs super block
70 * @sb: VFS super block 72 * @sb: VFS super block
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index b676cf6fd93c..78416eb2a168 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -2250,40 +2250,6 @@ static struct super_operations ntfs_sops = {
2250 proc. */ 2250 proc. */
2251}; 2251};
2252 2252
2253
2254/**
2255 * Declarations for NTFS specific export operations (fs/ntfs/namei.c).
2256 */
2257extern struct dentry *ntfs_get_parent(struct dentry *child_dent);
2258extern struct dentry *ntfs_get_dentry(struct super_block *sb, void *fh);
2259
2260/**
2261 * Export operations allowing NFS exporting of mounted NTFS partitions.
2262 *
2263 * We use the default ->decode_fh() and ->encode_fh() for now. Note that they
2264 * use 32 bits to store the inode number which is an unsigned long so on 64-bit
2265 * architectures is usually 64 bits so it would all fail horribly on huge
2266 * volumes. I guess we need to define our own encode and decode fh functions
2267 * that store 64-bit inode numbers at some point but for now we will ignore the
2268 * problem...
2269 *
2270 * We also use the default ->get_name() helper (used by ->decode_fh() via
2271 * fs/exportfs/expfs.c::find_exported_dentry()) as that is completely fs
2272 * independent.
2273 *
2274 * The default ->get_parent() just returns -EACCES so we have to provide our
2275 * own and the default ->get_dentry() is incompatible with NTFS due to not
2276 * allowing the inode number 0 which is used in NTFS for the system file $MFT
2277 * and due to using iget() whereas NTFS needs ntfs_iget().
2278 */
2279static struct export_operations ntfs_export_ops = {
2280 .get_parent = ntfs_get_parent, /* Find the parent of a given
2281 directory. */
2282 .get_dentry = ntfs_get_dentry, /* Find a dentry for the inode
2283 given a file handle
2284 sub-fragment. */
2285};
2286
2287/** 2253/**
2288 * ntfs_fill_super - mount an ntfs filesystem 2254 * ntfs_fill_super - mount an ntfs filesystem
2289 * @sb: super block of ntfs filesystem to mount 2255 * @sb: super block of ntfs filesystem to mount