aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/dir.c
diff options
context:
space:
mode:
authorSteven J. Magnani <steve@digidescorp.com>2012-10-04 20:14:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:05:09 -0400
commit7669e8fb09da47dd45c07a51394f01031ea81da8 (patch)
tree1112667a0606e27999a18b8dae574ae8ad01a151 /fs/fat/dir.c
parent21b6633d516c4f5d03ec02ede6374e320191003f (diff)
fat (exportfs): fix dentry reconnection
Maintain an index of directory inodes by starting cluster, so that fat_get_parent() can return the proper cached inode rather than inventing one that cannot be traced back to the filesystem root. Add a new msdos/vfat binary mount option "nfs" so that FAT filesystems that are _not_ exported via NFS are not saddled with maintenance of an index they will never use. Finally, simplify NFS file handle generation and lookups. An ext2-congruent implementation is adequate for FAT needs. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat/dir.c')
-rw-r--r--fs/fat/dir.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index d70d8f31f704..55e088cc0613 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -872,21 +872,23 @@ static int fat_get_short_entry(struct inode *dir, loff_t *pos,
872} 872}
873 873
874/* 874/*
875 * The ".." entry can not provide the "struct fat_slot_info" informations 875 * The ".." entry can not provide the "struct fat_slot_info" information
876 * for inode. So, this function provide the some informations only. 876 * for inode, nor a usable i_pos. So, this function provides some information
877 * only.
878 *
879 * Since this function walks through the on-disk inodes within a directory,
880 * callers are responsible for taking any locks necessary to prevent the
881 * directory from changing.
877 */ 882 */
878int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh, 883int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh,
879 struct msdos_dir_entry **de, loff_t *i_pos) 884 struct msdos_dir_entry **de)
880{ 885{
881 loff_t offset; 886 loff_t offset = 0;
882 887
883 offset = 0; 888 *de = NULL;
884 *bh = NULL;
885 while (fat_get_short_entry(dir, &offset, bh, de) >= 0) { 889 while (fat_get_short_entry(dir, &offset, bh, de) >= 0) {
886 if (!strncmp((*de)->name, MSDOS_DOTDOT, MSDOS_NAME)) { 890 if (!strncmp((*de)->name, MSDOS_DOTDOT, MSDOS_NAME))
887 *i_pos = fat_make_i_pos(dir->i_sb, *bh, *de);
888 return 0; 891 return 0;
889 }
890 } 892 }
891 return -ENOENT; 893 return -ENOENT;
892} 894}