updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / shfs / 2618fix.diff
blob972b0ef0016f51202d3b4d4e4cd2afd2cd20afc7
1 Index: shfs-0.35/shfs/Linux-2.6/inode.c
2 ===================================================================
3 --- shfs-0.35.orig/shfs/Linux-2.6/inode.c
4 +++ shfs-0.35/shfs/Linux-2.6/inode.c
5 @@ -341,12 +341,21 @@ out:
6 return -EINVAL;
9 +#ifdef NEW_VFS_DENTRY_API
10 +static int
11 +shfs_get_sb(struct file_system_type *fs_type,
12 + int flags, const char *dev_name, void *data, struct vfsmount *mnt)
14 + return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
16 +#else
17 static struct super_block *
18 shfs_get_sb(struct file_system_type *fs_type,
19 int flags, const char *dev_name, void *data)
21 return get_sb_nodev(fs_type, flags, data, shfs_read_super);
23 +#endif
25 static struct file_system_type sh_fs_type = {
26 .owner = THIS_MODULE,
27 Index: shfs-0.35/shfs/Linux-2.6/file.c
28 ===================================================================
29 --- shfs-0.35.orig/shfs/Linux-2.6/file.c
30 +++ shfs-0.35/shfs/Linux-2.6/file.c
31 @@ -199,7 +199,7 @@ shfs_file_open(struct inode *inode, stru
34 static int
35 -shfs_file_flush(struct file *f)
36 +do_file_flush(struct file *f)
38 struct dentry *dentry = f->f_dentry;
39 struct shfs_sb_info *info = info_from_dentry(dentry);
40 @@ -222,6 +222,16 @@ shfs_file_flush(struct file *f)
43 static int
44 +#ifdef FLUSH_HAS_LOCK_OWNER
45 +shfs_file_flush(struct file *f, fl_owner_t id)
46 +#else
47 +shfs_file_flush(struct file *f)
48 +#endif
50 + return do_file_flush(f);
53 +static int
54 shfs_file_release(struct inode *inode, struct file *f)
56 struct dentry *dentry = f->f_dentry;
57 @@ -311,7 +321,7 @@ shfs_slow_write(struct file *f, const ch
58 DEBUG("\n");
59 written = generic_file_write(f, buf, count, offset);
60 if (written > 0) {
61 - result = shfs_file_flush(f);
62 + result = do_file_flush(f);
63 written = result < 0 ? result: written;
66 Index: shfs-0.35/shfs/Linux-2.6/proc.c
67 ===================================================================
68 --- shfs-0.35.orig/shfs/Linux-2.6/proc.c
69 +++ shfs-0.35/shfs/Linux-2.6/proc.c
70 @@ -570,6 +570,16 @@ error:
71 return result;
74 +#ifdef NEW_VFS_DENTRY_API
75 +int
76 +shfs_statfs(struct dentry *dentry, struct kstatfs *attr)
78 + struct shfs_sb_info *info = info_from_sb(dentry->d_sb);
80 + DEBUG("\n");
81 + return info->fops.statfs(info, attr);
83 +#else
84 int
85 shfs_statfs(struct super_block *sb, struct kstatfs *attr)
87 @@ -578,4 +588,5 @@ shfs_statfs(struct super_block *sb, stru
88 DEBUG("\n");
89 return info->fops.statfs(info, attr);
91 +#endif
93 Index: shfs-0.35/shfs/Linux-2.6/shfs_fs.h
94 ===================================================================
95 --- shfs-0.35.orig/shfs/Linux-2.6/shfs_fs.h
96 +++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h
97 @@ -9,6 +9,12 @@
99 #include <linux/ioctl.h>
100 #include <linux/pagemap.h>
101 +#include <linux/version.h>
103 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
104 +#define NEW_VFS_DENTRY_API
105 +#define FLUSH_HAS_LOCK_OWNER
106 +#endif
108 #define SHFS_MAX_AGE(info) (((info)->ttl * HZ) / 1000)
109 #define SOCKBUF_SIZE (SHFS_PATH_MAX * 10)
110 @@ -100,7 +106,12 @@ int reply(char *s);
111 void set_garbage(struct shfs_sb_info *info, int write, int count);
112 int get_name(struct dentry *d, char *name);
113 int shfs_notify_change(struct dentry *dentry, struct iattr *attr);
115 +#ifdef NEW_VFS_DENTRY_API
116 +int shfs_statfs(struct dentry *dentry, struct kstatfs *attr);
117 +#else
118 int shfs_statfs(struct super_block *sb, struct kstatfs *attr);
119 +#endif
121 /* shfs/inode.c */
122 void shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr);
123 Index: shfs-0.35/shfs/Linux-2.6/symlink.c
124 ===================================================================
125 --- shfs-0.35.orig/shfs/Linux-2.6/symlink.c
126 +++ shfs-0.35/shfs/Linux-2.6/symlink.c
127 @@ -41,7 +41,7 @@ error:
128 return result;
131 -static int
132 +static void *
133 shfs_follow_link(struct dentry *dentry, struct nameidata *nd)
135 struct shfs_sb_info *info = info_from_dentry(dentry);
136 @@ -61,7 +61,7 @@ shfs_follow_link(struct dentry *dentry,
137 DEBUG("%s\n", real_name);
138 result = vfs_follow_link(nd, real_name);
139 error:
140 - return result;
141 + return NULL;
144 struct inode_operations shfs_symlink_inode_operations = {