aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-21 10:20:51 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-21 10:20:51 -0800
commitdec677f3704efd9956cc8ea50cb9e2d79d273cc4 (patch)
treee6218c52df0bd177deec4dc5d00a93741d55a4d9
parent940385ac6f6faea86284ee9f56f0c9a6984d46c2 (diff)
downloadpatches-dec677f3704efd9956cc8ea50cb9e2d79d273cc4.tar.gz
get readdir working for exfat
-rw-r--r--staging-exfat-readdir-to-iterate-change.patch84
1 files changed, 28 insertions, 56 deletions
diff --git a/staging-exfat-readdir-to-iterate-change.patch b/staging-exfat-readdir-to-iterate-change.patch
index b2dc9814dc14f4..925198d4280c50 100644
--- a/staging-exfat-readdir-to-iterate-change.patch
+++ b/staging-exfat-readdir-to-iterate-change.patch
@@ -13,12 +13,12 @@ verify I didn't mess anything up.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- drivers/staging/exfat/exfat_super.c | 52 +++++++++++++++---------------------
- 1 file changed, 23 insertions(+), 29 deletions(-)
+ drivers/staging/exfat/exfat_super.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
-@@ -274,36 +274,26 @@ static void __set_sb_clean(struct super_
+@@ -274,9 +274,9 @@ static void __set_sb_clean(struct super_
#endif
}
@@ -26,83 +26,55 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+static int exfat_iterate(struct file *file, struct dir_context *ctx)
{
- struct inode *inode = filp->f_path.dentry->d_inode;
-+ struct inode *inode = file->f_path.dentry->d_inode;
++ struct inode *inode = file_inode(file);
struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
FS_INFO_T *p_fs = &(sbi->fs_info);
- BD_INFO_T *p_bd = &(EXFAT_SB(sb)->bd_info);
- DIR_ENTRY_T de;
-- unsigned long inum;
-+ int fake_offset = 0;
- loff_t cpos;
- int err = 0;
+@@ -288,7 +288,7 @@ static int exfat_readdir(struct file *fi
__lock_super(sb);
- cpos = filp->f_pos;
+ cpos = ctx->pos;
if ((p_fs->vol_type == EXFAT) || (inode->i_ino == EXFAT_ROOT_INO)) {
-- while (cpos < 2) {
-- if (inode->i_ino == EXFAT_ROOT_INO)
-- inum = EXFAT_ROOT_INO;
-- else if (cpos == 0)
-- inum = inode->i_ino;
-- else
+ while (cpos < 2) {
+ if (inode->i_ino == EXFAT_ROOT_INO)
+@@ -296,12 +296,12 @@ static int exfat_readdir(struct file *fi
+ else if (cpos == 0)
+ inum = inode->i_ino;
+ else
- inum = parent_ino(filp->f_path.dentry);
--
++ inum = parent_ino(file->f_path.dentry);
+
- if (filldir(dirent, "..", cpos+1, cpos, inum, DT_DIR) < 0)
-- goto out;
-- cpos++;
++ if (!dir_emit_dots(file, ctx))
+ goto out;
+ cpos++;
- filp->f_pos++;
-- }
-- if (cpos == 2) {
-+ if (!dir_emit_dots(file, ctx))
-+ goto out;
-+ if (ctx->pos == 2) {
-+ fake_offset = 1;
- cpos = 0;
++ ctx->pos++;
}
- }
-@@ -327,16 +317,20 @@ get_new:
- goto end_of_dir;
- }
-
-- cpos = EXFAT_I(inode)->fid.rwoffset << DENTRY_SIZE_BITS;
--
- if (!de.Name[0])
- goto end_of_dir;
-
-+ if (!fake_offset)
-+ ctx->pos = EXFAT_I(inode)->fid.rwoffset << DENTRY_SIZE_BITS;
-+
+ if (cpos == 2) {
+ cpos = 0;
+@@ -335,7 +335,7 @@ get_new:
if (!memcmp(de.ShortName, DOS_CUR_DIR_NAME, DOS_NAME_LENGTH)) {
-- inum = inode->i_ino;
-+ if (!dir_emit_dot(file, ctx))
-+ goto out;
+ inum = inode->i_ino;
} else if (!memcmp(de.ShortName, DOS_PAR_DIR_NAME, DOS_NAME_LENGTH)) {
- inum = parent_ino(filp->f_path.dentry);
-+ if (!dir_emit_dotdot(file, ctx))
-+ goto out;
++ inum = parent_ino(file->f_path.dentry);
} else {
-+ unsigned long inum;
loff_t i_pos = ((loff_t) EXFAT_I(inode)->fid.start_clu << 32) |
((EXFAT_I(inode)->fid.rwoffset-1) & 0xffffffff);
-
-@@ -347,17 +341,17 @@ get_new:
- } else {
- inum = iunique(sb, EXFAT_ROOT_INO);
+@@ -349,15 +349,15 @@ get_new:
}
-+ if (!dir_emit(ctx, de.Name, strlen(de.Name), inum,
-+ (de.Attr & ATTR_SUBDIR) ? DT_DIR : DT_REG))
-+ goto out;
}
- if (filldir(dirent, de.Name, strlen(de.Name), cpos-1, inum,
- (de.Attr & ATTR_SUBDIR) ? DT_DIR : DT_REG) < 0)
-- goto out;
--
++ if (!dir_emit(ctx, de.Name, strlen(de.Name), inum,
++ (de.Attr & ATTR_SUBDIR) ? DT_DIR : DT_REG))
+ goto out;
+
- filp->f_pos = cpos;
-+ fake_offset = 0;
+ ctx->pos = cpos;
goto get_new;
@@ -112,7 +84,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
out:
__unlock_super(sb);
return err;
-@@ -437,7 +431,7 @@ static int exfat_file_fsync(struct file
+@@ -437,7 +437,7 @@ static int exfat_file_fsync(struct file
const struct file_operations exfat_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,