aboutsummaryrefslogtreecommitdiffstats
path: root/package/shfs/patches
diff options
context:
space:
mode:
Diffstat (limited to 'package/shfs/patches')
-rw-r--r--package/shfs/patches/100-kmod_build.patch100
-rw-r--r--package/shfs/patches/101-shfs_0.35_2.6.18_dentry.patch166
-rw-r--r--package/shfs/patches/102-shfs_0.35_clean_inode_clear.patch22
-rw-r--r--package/shfs/patches/103-shfs_0.35_gcc4.patch25
-rw-r--r--package/shfs/patches/104-shfs_0.35_inode_and_fs.patch377
-rw-r--r--package/shfs/patches/105-space_chars.patch70
-rw-r--r--package/shfs/patches/106-uidgid32.patch38
-rw-r--r--package/shfs/patches/107-df.patch38
-rw-r--r--package/shfs/patches/108-no_update_mtab.patch28
-rw-r--r--package/shfs/patches/109-linux_2.6.22.patch26
10 files changed, 0 insertions, 890 deletions
diff --git a/package/shfs/patches/100-kmod_build.patch b/package/shfs/patches/100-kmod_build.patch
deleted file mode 100644
index 16f198c4f6..0000000000
--- a/package/shfs/patches/100-kmod_build.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.4/Makefile
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.4/Makefile 2007-06-04 13:22:58.143016200 +0200
-+++ shfs-0.35/shfs/Linux-2.4/Makefile 2007-06-04 13:22:58.209006168 +0200
-@@ -1,3 +1,13 @@
-+#
-+# the original Makefile was trashed and replaced by this one
-+# The main reason is that loadable modules should be built with
-+# the same compile flags the kernel was built with, so we'd better
-+# let the kernel tree build the module for us, like that :
-+#
-+# make -C $(KERNEL_DIR) SUBDIRS="$(shell pwd)" modules
-+# make -C $(KERNEL_DIR) SUBDIRS="$(shell pwd)" modules_install
-+#
-+
- ifndef KERNEL
- KERNEL=$(shell uname -r)
- endif
-@@ -10,67 +20,29 @@
- KERNEL_SOURCES=${MODULESDIR}/build
- endif
-
--ifeq (${MODVERSIONS},detect)
-- ifeq ($(shell test -e ${KERNEL_SOURCES}/include/linux/modversions.h; echo $$?),0)
-- MODVERSIONS=yes
-- endif
--endif
--
--ifeq (${MODVERSIONS},yes)
--MVER=-DMODVERSIONS -DEXPORT_SYMTAB
--endif
--
--LINVER=linux-${KERNEL}
--
--ALL_TARGETS := shfs.o
--
--SEARCHDIRS := -I- -I. -I${KERNEL_SOURCES}/include #-I/usr/src/linux/include/
-+all: all-y
-
--CC := gcc
--CFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -Wall ${SEARCHDIRS} -DMODULE ${MVER} -D__KERNEL__ -DLINUX
--LINKER := ld
--LDFLAGS = -r
--LOADLIBES :=
-+O_TARGET := shfs.o
-
--all: ${ALL_TARGETS}
-+shfs-objs := dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
-
--%.o: %.c $(wildcard *.h)
-- ${CC} ${CFLAGS} -c $< -o $@
-+obj-y := $(shfs-objs)
-+obj-m := $(O_TARGET)
-
--shfs.o: dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
-- ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}
--
--tidy:
-- ${RM} core dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
--
--clean: tidy patch-clean
-- ${RM} shfs.o
-+-include $(TOPDIR)/Rules.make
-
-+all-y:
-+ make -C ${KERNEL_SOURCES} TOPDIR="${KERNEL_SOURCES}" SUBDIRS="$(shell pwd)" modules
-+
- install: shfs.o
- rm -f ${MODULESDIR}/kernel/fs/shfs/shfs.o
- install -m644 -b -D shfs.o ${MODULESDIR}/kernel/fs/shfs/shfs.o
-- if [ -x /sbin/depmod -a "${ROOT}" = "/" ]; then /sbin/depmod -aq; fi
-
- uninstall:
- rm -rf ${MODULESDIR}/kernel/fs/shfs
-- if [ -x /sbin/depmod -a "${ROOT}" = "/" ]; then /sbin/depmod -aq; fi
-
--patch:
-- rm -rf ${LINVER} ${LINVER}.orig; mkdir ${LINVER};
-- for i in Documentation fs/shfs include/linux; do \
-- mkdir -p ${LINVER}/$$i; \
-- done
-- cp ${KERNEL_SOURCES}/Documentation/Configure.help ${LINVER}/Documentation
-- cp ${KERNEL_SOURCES}/fs/{Makefile,Config.in} ${LINVER}/fs
-- cp -r ${LINVER} ${LINVER}.orig
-- cp ../../Changelog *.c shfs_debug.h proc.h ${LINVER}/fs/shfs/
-- cp shfs.h shfs_fs* ${LINVER}/include/linux/
-- (cd ${LINVER}; patch -p1 <../kernel-config.diff)
-- find . -type f -name "*.orig" -print | xargs rm -f
-- diff -urN ${LINVER}.orig ${LINVER} >${LINVER}.diff; true
--
--patch-clean:
-- rm -rf ${LINVER} ${LINVER}.orig;
-- rm -f ${LINVER}.diff
--
--.PHONY : all tidy clean install uninstall patch patch-clean
-+clean:
-+ rm -f core *.o *.a *.s
-+
-+shfs.o: $(shfs-objs)
-+
diff --git a/package/shfs/patches/101-shfs_0.35_2.6.18_dentry.patch b/package/shfs/patches/101-shfs_0.35_2.6.18_dentry.patch
deleted file mode 100644
index e7754b037d..0000000000
--- a/package/shfs/patches/101-shfs_0.35_2.6.18_dentry.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.6/inode.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.091024104 +0200
-+++ shfs-0.35/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.397977440 +0200
-@@ -337,12 +337,21 @@
- return -EINVAL;
- }
-
-+#ifdef NEW_VFS_DENTRY_API
-+static int
-+shfs_get_sb(struct file_system_type *fs_type,
-+ int flags, const char *dev_name, void *data, struct vfsmount *mnt)
-+{
-+ return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
-+}
-+#else
- static struct super_block *
- shfs_get_sb(struct file_system_type *fs_type,
- int flags, const char *dev_name, void *data)
- {
- return get_sb_nodev(fs_type, flags, data, shfs_read_super);
- }
-+#endif
-
- static struct file_system_type sh_fs_type = {
- .owner = THIS_MODULE,
-Index: shfs-0.35/shfs/Linux-2.6/file.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/file.c 2007-06-04 13:22:58.096023344 +0200
-+++ shfs-0.35/shfs/Linux-2.6/file.c 2007-06-04 13:22:58.397977440 +0200
-@@ -199,7 +199,7 @@
- }
-
- static int
--shfs_file_flush(struct file *f)
-+do_file_flush(struct file *f)
- {
- struct dentry *dentry = f->f_dentry;
- struct shfs_sb_info *info = info_from_dentry(dentry);
-@@ -222,6 +222,16 @@
- }
-
- static int
-+#ifdef FLUSH_HAS_LOCK_OWNER
-+shfs_file_flush(struct file *f, fl_owner_t id)
-+#else
-+shfs_file_flush(struct file *f)
-+#endif
-+{
-+ return do_file_flush(f);
-+}
-+
-+static int
- shfs_file_release(struct inode *inode, struct file *f)
- {
- struct dentry *dentry = f->f_dentry;
-@@ -311,7 +321,7 @@
- DEBUG("\n");
- written = generic_file_write(f, buf, count, offset);
- if (written > 0) {
-- result = shfs_file_flush(f);
-+ result = do_file_flush(f);
- written = result < 0 ? result: written;
- }
-
-Index: shfs-0.35/shfs/Linux-2.6/proc.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.102022432 +0200
-+++ shfs-0.35/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.398977288 +0200
-@@ -570,6 +570,16 @@
- return result;
- }
-
-+#ifdef NEW_VFS_DENTRY_API
-+int
-+shfs_statfs(struct dentry *dentry, struct kstatfs *attr)
-+{
-+ struct shfs_sb_info *info = info_from_sb(dentry->d_sb);
-+
-+ DEBUG("\n");
-+ return info->fops.statfs(info, attr);
-+}
-+#else
- int
- shfs_statfs(struct super_block *sb, struct kstatfs *attr)
- {
-@@ -578,4 +588,5 @@
- DEBUG("\n");
- return info->fops.statfs(info, attr);
- }
-+#endif
-
-Index: shfs-0.35/shfs/Linux-2.6/shfs_fs.h
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.107021672 +0200
-+++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.398977288 +0200
-@@ -9,6 +9,12 @@
-
- #include <linux/ioctl.h>
- #include <linux/pagemap.h>
-+#include <linux/version.h>
-+
-+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
-+#define NEW_VFS_DENTRY_API
-+#define FLUSH_HAS_LOCK_OWNER
-+#endif
-
- #define SHFS_MAX_AGE(info) (((info)->ttl * HZ) / 1000)
- #define SOCKBUF_SIZE (SHFS_PATH_MAX * 10)
-@@ -101,7 +107,12 @@
- void set_garbage(struct shfs_sb_info *info, int write, int count);
- int get_name(struct dentry *d, char *name);
- int shfs_notify_change(struct dentry *dentry, struct iattr *attr);
-+
-+#ifdef NEW_VFS_DENTRY_API
-+int shfs_statfs(struct dentry *dentry, struct kstatfs *attr);
-+#else
- int shfs_statfs(struct super_block *sb, struct kstatfs *attr);
-+#endif
-
- /* shfs/inode.c */
- void shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr);
-Index: shfs-0.35/shfs/Linux-2.6/symlink.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/symlink.c 2007-06-04 13:22:58.113020760 +0200
-+++ shfs-0.35/shfs/Linux-2.6/symlink.c 2007-06-04 13:22:58.398977288 +0200
-@@ -41,7 +41,7 @@
- return result;
- }
-
--static int
-+static void *
- shfs_follow_link(struct dentry *dentry, struct nameidata *nd)
- {
- struct shfs_sb_info *info = info_from_dentry(dentry);
-@@ -61,7 +61,7 @@
- DEBUG("%s\n", real_name);
- result = vfs_follow_link(nd, real_name);
- error:
-- return result;
-+ return NULL;
- }
-
- struct inode_operations shfs_symlink_inode_operations = {
-Index: shfs-0.35/shfs/Linux-2.6/dcache.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/dcache.c 2007-06-04 13:22:58.121019544 +0200
-+++ shfs-0.35/shfs/Linux-2.6/dcache.c 2007-06-04 13:22:58.398977288 +0200
-@@ -68,7 +68,7 @@
- spin_lock(&dcache_lock);
- next = parent->d_subdirs.next;
- while (next != &parent->d_subdirs) {
-- dentry = list_entry(next, struct dentry, d_child);
-+ dentry = list_entry(next, struct dentry, d_u.d_child);
- dentry->d_fsdata = NULL;
- shfs_age_dentry(info, dentry);
- next = next->next;
-@@ -101,7 +101,7 @@
- spin_lock(&dcache_lock);
- next = parent->d_subdirs.next;
- while (next != &parent->d_subdirs) {
-- dent = list_entry(next, struct dentry, d_child);
-+ dent = list_entry(next, struct dentry, d_u.d_child);
- if ((unsigned long)dent->d_fsdata == fpos) {
- if (dent->d_inode)
- dget_locked(dent);
diff --git a/package/shfs/patches/102-shfs_0.35_clean_inode_clear.patch b/package/shfs/patches/102-shfs_0.35_clean_inode_clear.patch
deleted file mode 100644
index f12fc96509..0000000000
--- a/package/shfs/patches/102-shfs_0.35_clean_inode_clear.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.6/inode.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.397977440 +0200
-+++ shfs-0.35/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.637940960 +0200
-@@ -8,6 +8,7 @@
- #include <linux/modversions.h>
- #endif
-
-+#include <linux/version.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
-@@ -118,6 +119,9 @@
- }
- KMEM_FREE("inode", inode_cache, i);
- out:
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13))
-+ truncate_inode_pages(&inode->i_data, 0);
-+#endif
- clear_inode(inode);
- }
-
diff --git a/package/shfs/patches/103-shfs_0.35_gcc4.patch b/package/shfs/patches/103-shfs_0.35_gcc4.patch
deleted file mode 100644
index e4c13882c4..0000000000
--- a/package/shfs/patches/103-shfs_0.35_gcc4.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.6/dir.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/dir.c 2007-06-04 13:22:58.041031704 +0200
-+++ shfs-0.35/shfs/Linux-2.6/dir.c 2007-06-04 13:22:58.822912840 +0200
-@@ -19,6 +19,8 @@
- #include "shfs_debug.h"
- #include "proc.h"
-
-+static struct dentry_operations shfs_dentry_operations;
-+
- static int
- shfs_dir_open(struct inode *inode, struct file *filp)
- {
-Index: shfs-0.35/shfs/Linux-2.6/shfs_fs.h
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.398977288 +0200
-+++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.823912688 +0200
-@@ -56,7 +56,6 @@
- #define ROUND_TO_MINS(x) do { (x).tv_sec = ((x).tv_sec / 60) * 60; (x).tv_nsec = 0; } while (0)
-
- /* shfs/dir.c */
--extern struct dentry_operations shfs_dentry_operations;
- extern struct file_operations shfs_dir_operations;
- extern struct inode_operations shfs_dir_inode_operations;
- extern void shfs_new_dentry(struct dentry *dentry);
diff --git a/package/shfs/patches/104-shfs_0.35_inode_and_fs.patch b/package/shfs/patches/104-shfs_0.35_inode_and_fs.patch
deleted file mode 100644
index 0953e6b0aa..0000000000
--- a/package/shfs/patches/104-shfs_0.35_inode_and_fs.patch
+++ /dev/null
@@ -1,377 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.6/fcache.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/fcache.c 2007-06-04 13:22:57.997038392 +0200
-+++ shfs-0.35/shfs/Linux-2.6/fcache.c 2007-06-04 13:22:59.019882896 +0200
-@@ -100,7 +100,11 @@
- VERBOSE("dir in file cache?\n");
- return -EINVAL;
- }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ p = (struct shfs_inode_info *)inode->i_private;
-+#else
- p = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- if (!p) {
- VERBOSE("inode without info\n");
- return -EINVAL;
-@@ -127,7 +131,11 @@
- VERBOSE("dir in file cache?\n");
- return -EINVAL;
- }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ p = (struct shfs_inode_info *)inode->i_private;
-+#else
- p = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- if (!p) {
- VERBOSE("inode without info\n");
- return -EINVAL;
-@@ -160,7 +168,11 @@
- if (result == 0) {
- struct shfs_inode_info *p;
-
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ p = (struct shfs_inode_info *)f->f_dentry->d_inode->i_private;
-+#else
- p = (struct shfs_inode_info *)f->f_dentry->d_inode->u.generic_ip;
-+#endif
- if (!p) {
- VERBOSE("inode without info\n");
- return -EINVAL;
-@@ -184,7 +196,11 @@
- return -EINVAL;
- }
- DEBUG("ino: %lu\n", inode->i_ino);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ p = (struct shfs_inode_info *)inode->i_private;
-+#else
- p = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- if (!p) {
- VERBOSE("inode without info\n");
- return -EINVAL;
-@@ -226,7 +242,11 @@
- VERBOSE("dir in file cache?\n");
- return -EINVAL;
- }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ p = (struct shfs_inode_info *)inode->i_private;
-+#else
- p = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- if (!p) {
- VERBOSE("inode without info\n");
- return -EINVAL;
-@@ -327,7 +347,11 @@
- VERBOSE("dir in file cache?\n");
- return -EINVAL;
- }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ p = (struct shfs_inode_info *)inode->i_private;
-+#else
- p = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- if (!p) {
- VERBOSE("inode without info\n");
- return -EINVAL;
-Index: shfs-0.35/shfs/Linux-2.6/inode.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.637940960 +0200
-+++ shfs-0.35/shfs/Linux-2.6/inode.c 2007-06-04 13:22:59.020882744 +0200
-@@ -36,7 +36,11 @@
- shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr)
- {
- struct shfs_sb_info *info = info_from_inode(inode);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ struct shfs_inode_info *i = inode->i_private;
-+#else
- struct shfs_inode_info *i = inode->u.generic_ip;
-+#endif
- struct timespec last_time = inode->i_mtime;
- loff_t last_size = inode->i_size;
-
-@@ -53,7 +57,9 @@
- inode->i_ctime = fattr->f_ctime;
- inode->i_atime = fattr->f_atime;
- inode->i_mtime = fattr->f_mtime;
-+#ifdef STRUCT_INODE_HAS_I_BLKSIZE
- inode->i_blksize= fattr->f_blksize;
-+#endif
- inode->i_blocks = fattr->f_blocks;
- inode->i_size = fattr->f_size;
-
-@@ -76,7 +82,11 @@
- if (!inode)
- return NULL;
- inode->i_ino = fattr->f_ino;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ i = inode->i_private = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
-+#else
- i = inode->u.generic_ip = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
-+#endif
- if (!i)
- return NULL;
- i->cache = NULL;
-@@ -108,7 +118,11 @@
- struct shfs_inode_info *i;
-
- DEBUG("ino: %lu\n", inode->i_ino);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ i = (struct shfs_inode_info *)inode->i_private;
-+#else
- i = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- if (!i) {
- VERBOSE("invalid inode\n");
- goto out;
-@@ -176,7 +190,11 @@
- {
- struct shfs_sb_info *info = info_from_dentry(dentry);
- struct inode *inode = dentry->d_inode;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
-+#else
- struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- int result;
-
- DEBUG("%s\n", dentry->d_name.name);
-Index: shfs-0.35/shfs/Linux-2.6/dir.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/dir.c 2007-06-04 13:22:58.822912840 +0200
-+++ shfs-0.35/shfs/Linux-2.6/dir.c 2007-06-04 13:22:59.020882744 +0200
-@@ -302,8 +302,13 @@
-
- shfs_invalid_dir_cache(dir);
- result = shfs_instantiate(dentry);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ if (forced_write && dentry->d_inode && dentry->d_inode->i_private)
-+ ((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close = 1;
-+#else
- if (forced_write && dentry->d_inode && dentry->d_inode->u.generic_ip)
- ((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close = 1;
-+#endif
- return result;
- }
-
-Index: shfs-0.35/shfs/Linux-2.6/file.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/file.c 2007-06-04 13:22:58.397977440 +0200
-+++ shfs-0.35/shfs/Linux-2.6/file.c 2007-06-04 13:22:59.020882744 +0200
-@@ -90,7 +90,11 @@
- struct dentry *dentry = f->f_dentry;
- struct shfs_sb_info *info = info_from_dentry(dentry);
- struct inode *inode = p->mapping->host;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
-+#else
- struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
-+#endif
- char *buffer = kmap(p) + offset;
- int written = 0, result;
- unsigned count = to - offset;
-@@ -252,8 +256,13 @@
- }
- }
- /* if file was forced to be writeable, change attrs back on close */
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ if (dentry->d_inode && dentry->d_inode->i_private) {
-+ if (((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close) {
-+#else
- if (dentry->d_inode && dentry->d_inode->u.generic_ip) {
- if (((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close) {
-+#endif
- char name[SHFS_PATH_MAX];
-
- if (get_name(dentry, name) < 0)
-@@ -302,7 +311,8 @@
- goto error;
- }
- if (result != 0) {
-- copy_to_user(buf, (char *)page, result);
-+ if (copy_to_user(buf, (char *)page, result))
-+ goto error;
- *ppos += result;
- }
- error:
-@@ -315,11 +325,15 @@
- static ssize_t
- shfs_slow_write(struct file *f, const char *buf, size_t count, loff_t *offset)
- {
-- int written = 0;
-+ ssize_t written = 0;
- int result;
-
- DEBUG("\n");
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ written = do_sync_write(f, buf, count, offset);
-+#else
- written = generic_file_write(f, buf, count, offset);
-+#endif
- if (written > 0) {
- result = do_file_flush(f);
- written = result < 0 ? result: written;
-@@ -330,14 +344,23 @@
-
- struct file_operations shfs_file_operations = {
- .llseek = generic_file_llseek,
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ .read = do_sync_read,
-+ .write = do_sync_write,
-+#else
- .read = generic_file_read,
- .write = generic_file_write,
-+#endif
- .ioctl = shfs_ioctl,
- .mmap = generic_file_mmap,
- .open = shfs_file_open,
- .flush = shfs_file_flush,
- .release = shfs_file_release,
- .fsync = shfs_file_sync,
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ .aio_read = generic_file_aio_read,
-+ .aio_write = generic_file_aio_write,
-+#endif
- };
-
- struct file_operations shfs_slow_operations = {
-Index: shfs-0.35/shfs/Linux-2.6/proc.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.398977288 +0200
-+++ shfs-0.35/shfs/Linux-2.6/proc.c 2007-06-04 13:22:59.021882592 +0200
-@@ -149,7 +149,12 @@
- {
- struct file *f = info->sock;
- mm_segment_t fs;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ ssize_t result = 0;
-+ loff_t begin;
-+#else
- int c, result = 0;
-+#endif
- unsigned long flags, sigpipe;
- sigset_t old_set;
-
-@@ -161,7 +166,9 @@
- return result;
- }
-
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
- c = count;
-+#endif
-
- fs = get_fs();
- set_fs(get_ds());
-@@ -173,6 +180,16 @@
- SIGRECALC;
- SIGUNLOCK(flags);
-
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ begin = f->f_pos;
-+ result = do_sync_write(f, buffer, count, &f->f_pos);
-+
-+ if (result < 0) {
-+ DEBUG("error: %d\n", result);
-+ fput(f);
-+ info->sock = NULL;
-+ }
-+#else
- do {
- struct iovec vec[1];
-
-@@ -190,6 +207,7 @@
- buffer += result;
- c -= result;
- } while (c > 0);
-+#endif
-
- SIGLOCK(flags);
- if (result == -EPIPE && !sigpipe) {
-@@ -204,7 +222,11 @@
-
- DEBUG(">%d\n", result);
- if (result < 0)
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ set_garbage(info, 1, count - (f->f_pos - begin));
-+#else
- set_garbage(info, 1, c);
-+#endif
- else
- result = count;
- return result;
-@@ -222,6 +244,9 @@
- int c, result = 0;
- unsigned long flags, sigpipe;
- sigset_t old_set;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ loff_t begin;
-+#endif
-
- if (!f)
- return -EIO;
-@@ -256,6 +281,20 @@
- fs = get_fs();
- set_fs(get_ds());
-
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ begin = f->f_pos;
-+ result = do_sync_read(f, buffer, c, &f->f_pos);
-+
-+ if (!result) {
-+ /* peer has closed socket */
-+ result = -EIO;
-+ }
-+ if (result < 0) {
-+ DEBUG("error: %d\n", result);
-+ fput(f);
-+ info->sock = NULL;
-+ }
-+#else
- do {
- struct iovec vec[1];
-
-@@ -277,6 +316,7 @@
- buffer += result;
- c -= result;
- } while (c > 0);
-+#endif
-
- SIGLOCK(flags);
- if (result == -EPIPE && !sigpipe) {
-@@ -291,7 +331,11 @@
-
- DEBUG("<%d\n", result);
- if (result < 0)
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ set_garbage(info, 0, count - (f->f_pos - begin));
-+#else
- set_garbage(info, 0, c);
-+#endif
- else
- result = count;
- return result;
-@@ -316,8 +360,10 @@
- return result;
- }
- while (1) {
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
- struct iovec vec[1];
-
-+#endif
- nl = memchr(BUFFER, '\n', LEN);
- if (nl) {
- *nl = '\0';
-@@ -348,9 +394,13 @@
- fs = get_fs();
- set_fs(get_ds());
-
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-+ result = do_sync_read(f, BUFFER+LEN, c, &f->f_pos);
-+#else
- vec[0].iov_base = BUFFER+LEN;
- vec[0].iov_len = c;
- result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
-+#endif
- SIGLOCK(flags);
- if (result == -EPIPE && !sigpipe) {
- sigdelset(&current->pending.signal, SIGPIPE);
diff --git a/package/shfs/patches/105-space_chars.patch b/package/shfs/patches/105-space_chars.patch
deleted file mode 100644
index 03ad8328c6..0000000000
--- a/package/shfs/patches/105-space_chars.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.4/shell.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.4/shell.c 2007-06-04 13:22:57.970042496 +0200
-+++ shfs-0.35/shfs/Linux-2.4/shell.c 2007-06-04 13:22:59.249847936 +0200
-@@ -213,6 +213,7 @@
- int c = 0;
- int is_space = 1;
- int device = 0;
-+ char *start = s;
-
- while (*s) {
- if (c == DIR_COLS)
-@@ -227,17 +228,20 @@
- s++;
- }
- *s = '\0';
-+ start = s+1;
- is_space = 1;
-+ } else {
-+ if (c != DIR_NAME)
-+ start = s+1;
- }
- } else {
- if (is_space) {
- /* (b)lock/(c)haracter device hack */
-- col[c++] = s;
-+ col[c++] = start;
- is_space = 0;
- if ((c-1 == DIR_PERM) && ((*s == 'b')||(*s == 'c'))) {
- device = 1;
- }
--
- }
- }
- s++;
-Index: shfs-0.35/shfs/Linux-2.6/shell.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/shell.c 2007-06-04 13:22:57.977041432 +0200
-+++ shfs-0.35/shfs/Linux-2.6/shell.c 2007-06-04 13:22:59.249847936 +0200
-@@ -225,6 +225,7 @@
- int c = 0;
- int is_space = 1;
- int device = 0;
-+ char *start = s;
-
- while (*s) {
- if (c == DIR_COLS)
-@@ -239,17 +240,20 @@
- s++;
- }
- *s = '\0';
-+ start = s+1;
- is_space = 1;
-+ } else {
-+ if (c != DIR_NAME)
-+ start = s+1;
- }
- } else {
- if (is_space) {
- /* (b)lock/(c)haracter device hack */
-- col[c++] = s;
-+ col[c++] = start;
- is_space = 0;
- if ((c-1 == DIR_PERM) && ((*s == 'b')||(*s == 'c'))) {
- device = 1;
- }
--
- }
- }
- s++;
diff --git a/package/shfs/patches/106-uidgid32.patch b/package/shfs/patches/106-uidgid32.patch
deleted file mode 100644
index 60510a28d3..0000000000
--- a/package/shfs/patches/106-uidgid32.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.4/shfs_fs_sb.h
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.4/shfs_fs_sb.h 2007-06-04 13:22:57.941046904 +0200
-+++ shfs-0.35/shfs/Linux-2.4/shfs_fs_sb.h 2007-06-04 13:22:59.448817688 +0200
-@@ -38,10 +38,10 @@
- struct shfs_fileops fops;
- int version;
- int ttl;
-- __kernel_uid_t uid;
-- __kernel_gid_t gid;
-- __kernel_mode_t root_mode;
-- __kernel_mode_t fmask;
-+ uid_t uid;
-+ gid_t gid;
-+ mode_t root_mode;
-+ mode_t fmask;
- char mount_point[SHFS_PATH_MAX];
- struct semaphore sock_sem; /* next 4 vars are guarded */
- struct file *sock;
-Index: shfs-0.35/shfs/Linux-2.6/shfs_fs_sb.h
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/shfs_fs_sb.h 2007-06-04 13:22:57.949045688 +0200
-+++ shfs-0.35/shfs/Linux-2.6/shfs_fs_sb.h 2007-06-04 13:22:59.449817536 +0200
-@@ -38,10 +38,10 @@
- struct shfs_fileops fops;
- int version;
- int ttl;
-- __kernel_uid_t uid;
-- __kernel_gid_t gid;
-- __kernel_mode_t root_mode;
-- __kernel_mode_t fmask;
-+ uid_t uid;
-+ gid_t gid;
-+ mode_t root_mode;
-+ mode_t fmask;
- char mount_point[SHFS_PATH_MAX];
- struct semaphore sock_sem; /* next 4 vars are guarded */
- struct file *sock;
diff --git a/package/shfs/patches/107-df.patch b/package/shfs/patches/107-df.patch
deleted file mode 100644
index ca2c9d079a..0000000000
--- a/package/shfs/patches/107-df.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.4/shell.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.4/shell.c 2007-06-04 13:22:59.249847936 +0200
-+++ shfs-0.35/shfs/Linux-2.4/shell.c 2007-06-04 13:22:59.643788048 +0200
-@@ -961,11 +961,11 @@
-
- s = info->sockbuf;
- if ((p = strsep(&s, " ")))
-- attr->f_blocks = simple_strtoull(p, NULL, 10);
-+ attr->f_blocks = simple_strtoull(p, NULL, 10) >> 2;
- if ((p = strsep(&s, " ")))
-- attr->f_bfree = attr->f_blocks - simple_strtoull(p, NULL, 10);
-+ attr->f_bfree = attr->f_blocks - (simple_strtoull(p, NULL, 10) >> 2);
- if ((p = strsep(&s, " ")))
-- attr->f_bavail = simple_strtoull(p, NULL, 10);
-+ attr->f_bavail = simple_strtoull(p, NULL, 10) >> 2;
-
- result = sock_readln(info, info->sockbuf, SOCKBUF_SIZE);
- if (result < 0)
-Index: shfs-0.35/shfs/Linux-2.6/shell.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/shell.c 2007-06-04 13:22:59.249847936 +0200
-+++ shfs-0.35/shfs/Linux-2.6/shell.c 2007-06-04 13:22:59.643788048 +0200
-@@ -974,11 +974,11 @@
-
- s = info->sockbuf;
- if ((p = strsep(&s, " ")))
-- attr->f_blocks = simple_strtoull(p, NULL, 10);
-+ attr->f_blocks = simple_strtoull(p, NULL, 10) >> 2;
- if ((p = strsep(&s, " ")))
-- attr->f_bfree = attr->f_blocks - simple_strtoull(p, NULL, 10);
-+ attr->f_bfree = attr->f_blocks - (simple_strtoull(p, NULL, 10) >> 2);
- if ((p = strsep(&s, " ")))
-- attr->f_bavail = simple_strtoull(p, NULL, 10);
-+ attr->f_bavail = simple_strtoull(p, NULL, 10) >> 2;
-
- result = sock_readln(info, info->sockbuf, SOCKBUF_SIZE);
- if (result < 0)
diff --git a/package/shfs/patches/108-no_update_mtab.patch b/package/shfs/patches/108-no_update_mtab.patch
deleted file mode 100644
index 9b4a9aeeb0..0000000000
--- a/package/shfs/patches/108-no_update_mtab.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Index: shfs-0.35/shfsmount/shfsmount.c
-===================================================================
---- shfs-0.35.orig/shfsmount/shfsmount.c 2007-06-04 13:22:57.883055720 +0200
-+++ shfs-0.35/shfsmount/shfsmount.c 2007-06-04 13:22:59.838758408 +0200
-@@ -74,7 +74,7 @@
- static int have_uid = 0;
-
- /* do not update /etc/mtab */
--static int nomtab = 0;
-+static int nomtab = 1;
-
- /* preserve owner of files */
- static int preserve = 0;
-Index: shfs-0.35/shfsmount/shfsumount.c
-===================================================================
---- shfs-0.35.orig/shfsmount/shfsumount.c 2007-06-04 13:22:57.890054656 +0200
-+++ shfs-0.35/shfsmount/shfsumount.c 2007-06-04 13:22:59.838758408 +0200
-@@ -67,10 +67,6 @@
- FILE *new_mtab;
- struct mntent *ment;
-
-- if ((fd = open(MOUNTED"~", O_RDWR|O_CREAT|O_EXCL, 0600)) == -1) {
-- fprintf(stderr, "Can't get "MOUNTED"~ lock file");
-- return 0;
-- }
- close(fd);
- if ((mtab = setmntent(MOUNTED, "r")) == NULL) {
- fprintf(stderr, "Can't open " MOUNTED ": %s\n", strerror(errno));
diff --git a/package/shfs/patches/109-linux_2.6.22.patch b/package/shfs/patches/109-linux_2.6.22.patch
deleted file mode 100644
index c91e0526d0..0000000000
--- a/package/shfs/patches/109-linux_2.6.22.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: shfs-0.35/shfs/Linux-2.6/dir.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/dir.c 2007-06-17 04:08:32.449815896 +0200
-+++ shfs-0.35/shfs/Linux-2.6/dir.c 2007-06-17 04:08:41.766399560 +0200
-@@ -13,6 +13,7 @@
- #include <asm/uaccess.h>
- #include <linux/smp_lock.h>
- #include <linux/stat.h>
-+#include <linux/jiffies.h>
-
- #include "shfs_fs.h"
- #include "shfs_fs_i.h"
-Index: shfs-0.35/shfs/Linux-2.6/inode.c
-===================================================================
---- shfs-0.35.orig/shfs/Linux-2.6/inode.c 2007-06-17 04:09:01.961329464 +0200
-+++ shfs-0.35/shfs/Linux-2.6/inode.c 2007-06-17 04:13:08.501849608 +0200
-@@ -15,6 +15,9 @@
- #include <asm/uaccess.h>
- #include <linux/file.h>
- #include <linux/smp_lock.h>
-+#include <linux/jiffies.h>
-+#include <linux/sched.h>
-+#include <asm/current.h>
-
- #include "shfs_fs.h"
- #include "shfs_fs_sb.h"