We do not need to make the experimental/install-experimental targets starting with...
[openwrt.git] / package / shfs / patches / 101-shfs_0.35_2.6.18_dentry.patch
1 Index: shfs-0.35/shfs/Linux-2.6/inode.c
2 ===================================================================
3 --- shfs-0.35.orig/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.091024104 +0200
4 +++ shfs-0.35/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.397977440 +0200
5 @@ -337,12 +337,21 @@
6 return -EINVAL;
7 }
8
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)
13 +{
14 + return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
15 +}
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)
20 {
21 return get_sb_nodev(fs_type, flags, data, shfs_read_super);
22 }
23 +#endif
24
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 2007-06-04 13:22:58.096023344 +0200
30 +++ shfs-0.35/shfs/Linux-2.6/file.c 2007-06-04 13:22:58.397977440 +0200
31 @@ -199,7 +199,7 @@
32 }
33
34 static int
35 -shfs_file_flush(struct file *f)
36 +do_file_flush(struct file *f)
37 {
38 struct dentry *dentry = f->f_dentry;
39 struct shfs_sb_info *info = info_from_dentry(dentry);
40 @@ -222,6 +222,16 @@
41 }
42
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
49 +{
50 + return do_file_flush(f);
51 +}
52 +
53 +static int
54 shfs_file_release(struct inode *inode, struct file *f)
55 {
56 struct dentry *dentry = f->f_dentry;
57 @@ -311,7 +321,7 @@
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;
64 }
65
66 Index: shfs-0.35/shfs/Linux-2.6/proc.c
67 ===================================================================
68 --- shfs-0.35.orig/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.102022432 +0200
69 +++ shfs-0.35/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.398977288 +0200
70 @@ -570,6 +570,16 @@
71 return result;
72 }
73
74 +#ifdef NEW_VFS_DENTRY_API
75 +int
76 +shfs_statfs(struct dentry *dentry, struct kstatfs *attr)
77 +{
78 + struct shfs_sb_info *info = info_from_sb(dentry->d_sb);
79 +
80 + DEBUG("\n");
81 + return info->fops.statfs(info, attr);
82 +}
83 +#else
84 int
85 shfs_statfs(struct super_block *sb, struct kstatfs *attr)
86 {
87 @@ -578,4 +588,5 @@
88 DEBUG("\n");
89 return info->fops.statfs(info, attr);
90 }
91 +#endif
92
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 2007-06-04 13:22:58.107021672 +0200
96 +++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.398977288 +0200
97 @@ -9,6 +9,12 @@
98
99 #include <linux/ioctl.h>
100 #include <linux/pagemap.h>
101 +#include <linux/version.h>
102 +
103 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
104 +#define NEW_VFS_DENTRY_API
105 +#define FLUSH_HAS_LOCK_OWNER
106 +#endif
107
108 #define SHFS_MAX_AGE(info) (((info)->ttl * HZ) / 1000)
109 #define SOCKBUF_SIZE (SHFS_PATH_MAX * 10)
110 @@ -101,7 +107,12 @@
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);
114 +
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
120
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 2007-06-04 13:22:58.113020760 +0200
126 +++ shfs-0.35/shfs/Linux-2.6/symlink.c 2007-06-04 13:22:58.398977288 +0200
127 @@ -41,7 +41,7 @@
128 return result;
129 }
130
131 -static int
132 +static void *
133 shfs_follow_link(struct dentry *dentry, struct nameidata *nd)
134 {
135 struct shfs_sb_info *info = info_from_dentry(dentry);
136 @@ -61,7 +61,7 @@
137 DEBUG("%s\n", real_name);
138 result = vfs_follow_link(nd, real_name);
139 error:
140 - return result;
141 + return NULL;
142 }
143
144 struct inode_operations shfs_symlink_inode_operations = {
145 Index: shfs-0.35/shfs/Linux-2.6/dcache.c
146 ===================================================================
147 --- shfs-0.35.orig/shfs/Linux-2.6/dcache.c 2007-06-04 13:22:58.121019544 +0200
148 +++ shfs-0.35/shfs/Linux-2.6/dcache.c 2007-06-04 13:22:58.398977288 +0200
149 @@ -68,7 +68,7 @@
150 spin_lock(&dcache_lock);
151 next = parent->d_subdirs.next;
152 while (next != &parent->d_subdirs) {
153 - dentry = list_entry(next, struct dentry, d_child);
154 + dentry = list_entry(next, struct dentry, d_u.d_child);
155 dentry->d_fsdata = NULL;
156 shfs_age_dentry(info, dentry);
157 next = next->next;
158 @@ -101,7 +101,7 @@
159 spin_lock(&dcache_lock);
160 next = parent->d_subdirs.next;
161 while (next != &parent->d_subdirs) {
162 - dent = list_entry(next, struct dentry, d_child);
163 + dent = list_entry(next, struct dentry, d_u.d_child);
164 if ((unsigned long)dent->d_fsdata == fpos) {
165 if (dent->d_inode)
166 dget_locked(dent);
This page took 0.048096 seconds and 5 git commands to generate.