fat (exportfs): fix dentry reconnection
[deliverable/linux.git] / fs / fat / dir.c
index dc49ed2cbffa66af9407f89886d8d84cf2dc9d0f..55e088cc061320f5ca93c55aa321ae848beb4e8a 100644 (file)
@@ -872,21 +872,23 @@ static int fat_get_short_entry(struct inode *dir, loff_t *pos,
 }
 
 /*
- * The ".." entry can not provide the "struct fat_slot_info" informations
- * for inode. So, this function provide the some informations only.
+ * The ".." entry can not provide the "struct fat_slot_info" information
+ * for inode, nor a usable i_pos. So, this function provides some information
+ * only.
+ *
+ * Since this function walks through the on-disk inodes within a directory,
+ * callers are responsible for taking any locks necessary to prevent the
+ * directory from changing.
  */
 int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh,
-                        struct msdos_dir_entry **de, loff_t *i_pos)
+                        struct msdos_dir_entry **de)
 {
-       loff_t offset;
+       loff_t offset = 0;
 
-       offset = 0;
-       *bh = NULL;
+       *de = NULL;
        while (fat_get_short_entry(dir, &offset, bh, de) >= 0) {
-               if (!strncmp((*de)->name, MSDOS_DOTDOT, MSDOS_NAME)) {
-                       *i_pos = fat_make_i_pos(dir->i_sb, *bh, *de);
+               if (!strncmp((*de)->name, MSDOS_DOTDOT, MSDOS_NAME))
                        return 0;
-               }
        }
        return -ENOENT;
 }
@@ -1141,10 +1143,8 @@ int fat_alloc_new_dir(struct inode *dir, struct timespec *ts)
                de[0].ctime_cs = de[1].ctime_cs = 0;
                de[0].adate = de[0].cdate = de[1].adate = de[1].cdate = 0;
        }
-       de[0].start = cpu_to_le16(cluster);
-       de[0].starthi = cpu_to_le16(cluster >> 16);
-       de[1].start = cpu_to_le16(MSDOS_I(dir)->i_logstart);
-       de[1].starthi = cpu_to_le16(MSDOS_I(dir)->i_logstart >> 16);
+       fat_set_start(&de[0], cluster);
+       fat_set_start(&de[1], MSDOS_I(dir)->i_logstart);
        de[0].size = de[1].size = 0;
        memset(de + 2, 0, sb->s_blocksize - 2 * sizeof(*de));
        set_buffer_uptodate(bhs[0]);
This page took 0.02811 seconds and 5 git commands to generate.