Forgot comitting patches
[openwrt/svn-archive/archive.git] / package / shfs / patches / 101-shfs_0.35_2.6.18_dentry.patch
1 --- shfs-0.35.orig/shfs/Linux-2.6/inode.c
2 +++ shfs-0.35/shfs/Linux-2.6/inode.c
3 @@ -341,12 +341,21 @@ out:
4 return -EINVAL;
5 }
6
7 +#ifdef NEW_VFS_DENTRY_API
8 +static int
9 +shfs_get_sb(struct file_system_type *fs_type,
10 + int flags, const char *dev_name, void *data, struct vfsmount *mnt)
11 +{
12 + return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
13 +}
14 +#else
15 static struct super_block *
16 shfs_get_sb(struct file_system_type *fs_type,
17 int flags, const char *dev_name, void *data)
18 {
19 return get_sb_nodev(fs_type, flags, data, shfs_read_super);
20 }
21 +#endif
22
23 static struct file_system_type sh_fs_type = {
24 .owner = THIS_MODULE,
25 --- shfs-0.35.orig/shfs/Linux-2.6/file.c
26 +++ shfs-0.35/shfs/Linux-2.6/file.c
27 @@ -199,7 +199,7 @@ shfs_file_open(struct inode *inode, stru
28 }
29
30 static int
31 -shfs_file_flush(struct file *f)
32 +do_file_flush(struct file *f)
33 {
34 struct dentry *dentry = f->f_dentry;
35 struct shfs_sb_info *info = info_from_dentry(dentry);
36 @@ -222,6 +222,16 @@ shfs_file_flush(struct file *f)
37 }
38
39 static int
40 +#ifdef FLUSH_HAS_LOCK_OWNER
41 +shfs_file_flush(struct file *f, fl_owner_t id)
42 +#else
43 +shfs_file_flush(struct file *f)
44 +#endif
45 +{
46 + return do_file_flush(f);
47 +}
48 +
49 +static int
50 shfs_file_release(struct inode *inode, struct file *f)
51 {
52 struct dentry *dentry = f->f_dentry;
53 @@ -311,7 +321,7 @@ shfs_slow_write(struct file *f, const ch
54 DEBUG("\n");
55 written = generic_file_write(f, buf, count, offset);
56 if (written > 0) {
57 - result = shfs_file_flush(f);
58 + result = do_file_flush(f);
59 written = result < 0 ? result: written;
60 }
61
62 Index: shfs-0.35/shfs/Linux-2.6/proc.c
63 ===================================================================
64 --- shfs-0.35.orig/shfs/Linux-2.6/proc.c
65 +++ shfs-0.35/shfs/Linux-2.6/proc.c
66 @@ -570,6 +570,16 @@ error:
67 return result;
68 }
69
70 +#ifdef NEW_VFS_DENTRY_API
71 +int
72 +shfs_statfs(struct dentry *dentry, struct kstatfs *attr)
73 +{
74 + struct shfs_sb_info *info = info_from_sb(dentry->d_sb);
75 +
76 + DEBUG("\n");
77 + return info->fops.statfs(info, attr);
78 +}
79 +#else
80 int
81 shfs_statfs(struct super_block *sb, struct kstatfs *attr)
82 {
83 @@ -578,4 +588,5 @@ shfs_statfs(struct super_block *sb, stru
84 DEBUG("\n");
85 return info->fops.statfs(info, attr);
86 }
87 +#endif
88
89 --- shfs-0.35.orig/shfs/Linux-2.6/shfs_fs.h
90 +++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h
91 @@ -9,6 +9,12 @@
92
93 #include <linux/ioctl.h>
94 #include <linux/pagemap.h>
95 +#include <linux/version.h>
96 +
97 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
98 +#define NEW_VFS_DENTRY_API
99 +#define FLUSH_HAS_LOCK_OWNER
100 +#endif
101
102 #define SHFS_MAX_AGE(info) (((info)->ttl * HZ) / 1000)
103 #define SOCKBUF_SIZE (SHFS_PATH_MAX * 10)
104 @@ -100,7 +106,12 @@ int reply(char *s);
105 void set_garbage(struct shfs_sb_info *info, int write, int count);
106 int get_name(struct dentry *d, char *name);
107 int shfs_notify_change(struct dentry *dentry, struct iattr *attr);
108 +
109 +#ifdef NEW_VFS_DENTRY_API
110 +int shfs_statfs(struct dentry *dentry, struct kstatfs *attr);
111 +#else
112 int shfs_statfs(struct super_block *sb, struct kstatfs *attr);
113 +#endif
114
115 /* shfs/inode.c */
116 void shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr);
117 --- shfs-0.35.orig/shfs/Linux-2.6/symlink.c
118 +++ shfs-0.35/shfs/Linux-2.6/symlink.c
119 @@ -41,7 +41,7 @@ error:
120 return result;
121 }
122
123 -static int
124 +static void *
125 shfs_follow_link(struct dentry *dentry, struct nameidata *nd)
126 {
127 struct shfs_sb_info *info = info_from_dentry(dentry);
128 @@ -61,7 +61,7 @@ shfs_follow_link(struct dentry *dentry,
129 DEBUG("%s\n", real_name);
130 result = vfs_follow_link(nd, real_name);
131 error:
132 - return result;
133 + return NULL;
134 }
135
136 struct inode_operations shfs_symlink_inode_operations = {
137 --- shfs-0.35.orig/shfs/Linux-2.6/dcache.c 2004-06-01 15:16:19.000000000 +0200
138 +++ shfs-0.35/shfs/Linux-2.6/dcache.c 2006-02-17 17:36:02.000000000 +0100
139 @@ -68,7 +68,7 @@
140 spin_lock(&dcache_lock);
141 next = parent->d_subdirs.next;
142 while (next != &parent->d_subdirs) {
143 - dentry = list_entry(next, struct dentry, d_child);
144 + dentry = list_entry(next, struct dentry, d_u.d_child);
145 dentry->d_fsdata = NULL;
146 shfs_age_dentry(info, dentry);
147 next = next->next;
148 @@ -101,7 +101,7 @@
149 spin_lock(&dcache_lock);
150 next = parent->d_subdirs.next;
151 while (next != &parent->d_subdirs) {
152 - dent = list_entry(next, struct dentry, d_child);
153 + dent = list_entry(next, struct dentry, d_u.d_child);
154 if ((unsigned long)dent->d_fsdata == fpos) {
155 if (dent->d_inode)
156 dget_locked(dent);