aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-20 12:13:42 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-20 12:13:42 -0800
commit940385ac6f6faea86284ee9f56f0c9a6984d46c2 (patch)
tree27b6c204dfe2e166d72d8d2fcd49132b90176d8a
parentd664bd7bf73c4513b3e35d4a49298a85833f7fec (diff)
downloadpatches-940385ac6f6faea86284ee9f56f0c9a6984d46c2.tar.gz
exfat
-rw-r--r--series5
-rw-r--r--staging-exfat-add-filesystem-to-the-build.patch61
-rw-r--r--staging-exfat-hlist_for_each-api-change.patch30
-rw-r--r--staging-exfat-include-aio.h.patch23
-rw-r--r--staging-exfat-readdir-to-iterate-change.patch123
-rw-r--r--staging-exfat-truncage_pagecache-api-change.patch25
6 files changed, 267 insertions, 0 deletions
diff --git a/series b/series
index ff5b8ffeae0760..563e5de733e576 100644
--- a/series
+++ b/series
@@ -1,4 +1,9 @@
staging-exfat-add-filesystem-to-drivers-staging-exfat.patch
+staging-exfat-add-filesystem-to-the-build.patch
+staging-exfat-include-aio.h.patch
+staging-exfat-hlist_for_each-api-change.patch
+staging-exfat-truncage_pagecache-api-change.patch
+staging-exfat-readdir-to-iterate-change.patch
diff --git a/staging-exfat-add-filesystem-to-the-build.patch b/staging-exfat-add-filesystem-to-the-build.patch
new file mode 100644
index 00000000000000..71d6fd1861f3eb
--- /dev/null
+++ b/staging-exfat-add-filesystem-to-the-build.patch
@@ -0,0 +1,61 @@
+From foo@baz Mon Nov 18 14:29:30 PST 2013
+Date: Mon, 18 Nov 2013 14:29:30 -0800
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: staging: exfat: add filesystem to the build
+
+This adds the needed Kconfig file and changes the Makefile for the
+filesytem to build properly within the kernel build system.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/Kconfig | 2 ++
+ drivers/staging/Makefile | 1 +
+ drivers/staging/exfat/Kconfig | 4 ++++
+ drivers/staging/exfat/Makefile | 14 ++++----------
+ 4 files changed, 11 insertions(+), 10 deletions(-)
+
+--- a/drivers/staging/Kconfig
++++ b/drivers/staging/Kconfig
+@@ -150,4 +150,6 @@ source "drivers/staging/dgnc/Kconfig"
+
+ source "drivers/staging/dgap/Kconfig"
+
++source "drivers/staging/exfat/Kconfig"
++
+ endif # STAGING
+--- a/drivers/staging/Makefile
++++ b/drivers/staging/Makefile
+@@ -67,3 +67,4 @@ obj-$(CONFIG_XILLYBUS) += xillybus/
+ obj-$(CONFIG_DGNC) += dgnc/
+ obj-$(CONFIG_DGAP) += dgap/
+ obj-$(CONFIG_MTD_SPINAND_MT29F) += mt29f_spinand/
++obj-$(CONFIG_EXFAT_FS) += exfat/
+--- /dev/null
++++ b/drivers/staging/exfat/Kconfig
+@@ -0,0 +1,4 @@
++config EXFAT_FS
++ tristate "EXFAT filesystem support"
++ help
++ If you want to use a EX-FAT filesystem, select this option.
+--- a/drivers/staging/exfat/Makefile
++++ b/drivers/staging/exfat/Makefile
+@@ -1,13 +1,7 @@
+-obj-m += exfat_core.o exfat_fs.o
++obj-$(CONFIG_EXFAT_FS) += exfat_core.o exfat_fs.o
+
+ exfat_fs-y := exfat_super.o
+
+-exfat_core-y := exfat.o exfat_api.o exfat_blkdev.o exfat_cache.o \
+- exfat_data.o exfat_global.o exfat_nls.o exfat_oal.o exfat_upcase.o
+-
+-all:
+- make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+-
+-clean:
+- make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
+-
++exfat_core-y := exfat.o exfat_api.o exfat_blkdev.o exfat_cache.o \
++ exfat_data.o exfat_global.o exfat_nls.o \
++ exfat_oal.o exfat_upcase.o
diff --git a/staging-exfat-hlist_for_each-api-change.patch b/staging-exfat-hlist_for_each-api-change.patch
new file mode 100644
index 00000000000000..18ecaade36243a
--- /dev/null
+++ b/staging-exfat-hlist_for_each-api-change.patch
@@ -0,0 +1,30 @@
+From foo@baz Tue Nov 19 09:15:12 PST 2013
+Date: Tue, 19 Nov 2013 09:15:12 -0800
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: staging: exfat: hlist_for_each api change
+
+hlist_for_each() has changed the api, dropping the unneeded parameter,
+so fix up the exfat code to handle this change as well.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/exfat/exfat_super.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/staging/exfat/exfat_super.c
++++ b/drivers/staging/exfat/exfat_super.c
+@@ -1403,12 +1403,11 @@ static inline unsigned long exfat_hash(l
+ static struct inode *exfat_iget(struct super_block *sb, loff_t i_pos) {
+ struct exfat_sb_info *sbi = EXFAT_SB(sb);
+ struct exfat_inode_info *info;
+- struct hlist_node *node;
+ struct hlist_head *head = sbi->inode_hashtable + exfat_hash(i_pos);
+ struct inode *inode = NULL;
+
+ spin_lock(&sbi->inode_hash_lock);
+- hlist_for_each_entry(info, node, head, i_hash_fat) {
++ hlist_for_each_entry(info, head, i_hash_fat) {
+ CHECK_ERR(info->vfs_inode.i_sb != sb);
+
+ if (i_pos != info->i_pos)
diff --git a/staging-exfat-include-aio.h.patch b/staging-exfat-include-aio.h.patch
new file mode 100644
index 00000000000000..d0bc12038fc698
--- /dev/null
+++ b/staging-exfat-include-aio.h.patch
@@ -0,0 +1,23 @@
+From foo@baz Tue Nov 19 09:14:33 PST 2013
+Date: Tue, 19 Nov 2013 09:14:33 -0800
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: staging: exfat: include aio.h
+
+aio.h needs to be included in order to resolve some structures.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/exfat/exfat_super.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/staging/exfat/exfat_super.c
++++ b/drivers/staging/exfat/exfat_super.c
+@@ -59,6 +59,7 @@
+ #include <linux/buffer_head.h>
+ #include <linux/exportfs.h>
+ #include <linux/mount.h>
++#include <linux/aio.h>
+ #include <linux/vfs.h>
+ #include <linux/parser.h>
+ #include <linux/uio.h>
diff --git a/staging-exfat-readdir-to-iterate-change.patch b/staging-exfat-readdir-to-iterate-change.patch
new file mode 100644
index 00000000000000..b2dc9814dc14f4
--- /dev/null
+++ b/staging-exfat-readdir-to-iterate-change.patch
@@ -0,0 +1,123 @@
+From foo@baz Mon Nov 18 17:17:51 PST 2013
+Date: Mon, 18 Nov 2013 17:17:51 -0800
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: staging: exfat: readdir to iterate change
+
+readdir has gone away from the vfs functions, moving to iterate to fix a
+number of issues. Port the exfat driver to this api.
+
+This port was based on commit 2c6a2473b800f8eadc94c9a711fee8671dd1a244
+([readdir] convert fatfs). I think it is correct, but others should
+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(-)
+
+--- 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_
+ #endif
+ }
+
+-static int exfat_readdir(struct file *filp, void *dirent, filldir_t filldir)
++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 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;
+
+ __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
+- inum = parent_ino(filp->f_path.dentry);
+-
+- if (filldir(dirent, "..", cpos+1, cpos, inum, DT_DIR) < 0)
+- 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;
+ }
+ }
+@@ -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 (!memcmp(de.ShortName, DOS_CUR_DIR_NAME, DOS_NAME_LENGTH)) {
+- inum = inode->i_ino;
++ if (!dir_emit_dot(file, ctx))
++ goto out;
+ } 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;
+ } 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);
+ }
++ 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;
+-
+- filp->f_pos = cpos;
++ fake_offset = 0;
++ ctx->pos = cpos;
+ goto get_new;
+
+ end_of_dir:
+- filp->f_pos = cpos;
++ ctx->pos = cpos;
+ out:
+ __unlock_super(sb);
+ return err;
+@@ -437,7 +431,7 @@ static int exfat_file_fsync(struct file
+ const struct file_operations exfat_dir_operations = {
+ .llseek = generic_file_llseek,
+ .read = generic_read_dir,
+- .readdir = exfat_readdir,
++ .iterate = exfat_iterate,
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+ .ioctl = exfat_generic_ioctl,
+ .fsync = exfat_file_fsync,
diff --git a/staging-exfat-truncage_pagecache-api-change.patch b/staging-exfat-truncage_pagecache-api-change.patch
new file mode 100644
index 00000000000000..d9bb8fff2a48cc
--- /dev/null
+++ b/staging-exfat-truncage_pagecache-api-change.patch
@@ -0,0 +1,25 @@
+From foo@baz Tue Nov 19 09:16:24 PST 2013
+Date: Tue, 19 Nov 2013 09:16:24 -0800
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: staging: exfat: truncage_pagecache() api change
+
+truncate_pagecache() has changed the parameters, removing an unneeded
+one, so make the same change to the exfat code.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/exfat/exfat_super.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/exfat/exfat_super.c
++++ b/drivers/staging/exfat/exfat_super.c
+@@ -1286,7 +1286,7 @@ static void exfat_write_failed(struct ad
+ {
+ struct inode *inode = mapping->host;
+ if (to > i_size_read(inode)) {
+- truncate_pagecache(inode, to, i_size_read(inode));
++ truncate_pagecache(inode, i_size_read(inode));
+ EXFAT_I(inode)->fid.size = i_size_read(inode);
+ _exfat_truncate(inode, i_size_read(inode));
+ }