5776fbc96c005c5b3f825162553ca17d7e09ad67
[openwrt/svn-archive/archive.git] / package / shfs / patches / 104-linux_2.6.19.patch
1 diff -urN shfs-0.35/shfs/Linux-2.6/dir.c shfs-0.35.new/shfs/Linux-2.6/dir.c
2 --- shfs-0.35/shfs/Linux-2.6/dir.c 2007-01-11 14:59:49.000000000 +0100
3 +++ shfs-0.35.new/shfs/Linux-2.6/dir.c 2007-01-11 14:55:21.000000000 +0100
4 @@ -302,8 +302,8 @@
5
6 shfs_invalid_dir_cache(dir);
7 result = shfs_instantiate(dentry);
8 - if (forced_write && dentry->d_inode && dentry->d_inode->u.generic_ip)
9 - ((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close = 1;
10 + if (forced_write && dentry->d_inode && dentry->d_inode->i_private)
11 + ((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close = 1;
12 return result;
13 }
14
15 diff -urN shfs-0.35/shfs/Linux-2.6/fcache.c shfs-0.35.new/shfs/Linux-2.6/fcache.c
16 --- shfs-0.35/shfs/Linux-2.6/fcache.c 2004-06-01 15:16:19.000000000 +0200
17 +++ shfs-0.35.new/shfs/Linux-2.6/fcache.c 2007-01-11 14:55:21.000000000 +0100
18 @@ -100,7 +100,7 @@
19 VERBOSE("dir in file cache?\n");
20 return -EINVAL;
21 }
22 - p = (struct shfs_inode_info *)inode->u.generic_ip;
23 + p = (struct shfs_inode_info *)inode->i_private;
24 if (!p) {
25 VERBOSE("inode without info\n");
26 return -EINVAL;
27 @@ -127,7 +127,7 @@
28 VERBOSE("dir in file cache?\n");
29 return -EINVAL;
30 }
31 - p = (struct shfs_inode_info *)inode->u.generic_ip;
32 + p = (struct shfs_inode_info *)inode->i_private;
33 if (!p) {
34 VERBOSE("inode without info\n");
35 return -EINVAL;
36 @@ -160,7 +160,7 @@
37 if (result == 0) {
38 struct shfs_inode_info *p;
39
40 - p = (struct shfs_inode_info *)f->f_dentry->d_inode->u.generic_ip;
41 + p = (struct shfs_inode_info *)f->f_dentry->d_inode->i_private;
42 if (!p) {
43 VERBOSE("inode without info\n");
44 return -EINVAL;
45 @@ -184,7 +184,7 @@
46 return -EINVAL;
47 }
48 DEBUG("ino: %lu\n", inode->i_ino);
49 - p = (struct shfs_inode_info *)inode->u.generic_ip;
50 + p = (struct shfs_inode_info *)inode->i_private;
51 if (!p) {
52 VERBOSE("inode without info\n");
53 return -EINVAL;
54 @@ -226,7 +226,7 @@
55 VERBOSE("dir in file cache?\n");
56 return -EINVAL;
57 }
58 - p = (struct shfs_inode_info *)inode->u.generic_ip;
59 + p = (struct shfs_inode_info *)inode->i_private;
60 if (!p) {
61 VERBOSE("inode without info\n");
62 return -EINVAL;
63 @@ -327,7 +327,7 @@
64 VERBOSE("dir in file cache?\n");
65 return -EINVAL;
66 }
67 - p = (struct shfs_inode_info *)inode->u.generic_ip;
68 + p = (struct shfs_inode_info *)inode->i_private;
69 if (!p) {
70 VERBOSE("inode without info\n");
71 return -EINVAL;
72 diff -urN shfs-0.35/shfs/Linux-2.6/file.c shfs-0.35.new/shfs/Linux-2.6/file.c
73 --- shfs-0.35/shfs/Linux-2.6/file.c 2004-06-01 15:16:19.000000000 +0200
74 +++ shfs-0.35.new/shfs/Linux-2.6/file.c 2007-01-11 14:55:21.000000000 +0100
75 @@ -9,6 +9,7 @@
76 #include <asm/fcntl.h>
77 #include <linux/smp_lock.h>
78 #include <linux/stat.h>
79 +#include <linux/fs.h>
80
81 #include "shfs_fs.h"
82 #include "shfs_fs_sb.h"
83 @@ -90,7 +91,7 @@
84 struct dentry *dentry = f->f_dentry;
85 struct shfs_sb_info *info = info_from_dentry(dentry);
86 struct inode *inode = p->mapping->host;
87 - struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
88 + struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
89 char *buffer = kmap(p) + offset;
90 int written = 0, result;
91 unsigned count = to - offset;
92 @@ -242,8 +243,8 @@
93 }
94 }
95 /* if file was forced to be writeable, change attrs back on close */
96 - if (dentry->d_inode && dentry->d_inode->u.generic_ip) {
97 - if (((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close) {
98 + if (dentry->d_inode && dentry->d_inode->i_private) {
99 + if (((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close) {
100 char name[SHFS_PATH_MAX];
101
102 if (get_name(dentry, name) < 0)
103 @@ -320,8 +321,8 @@
104
105 struct file_operations shfs_file_operations = {
106 .llseek = generic_file_llseek,
107 - .read = generic_file_read,
108 - .write = generic_file_write,
109 + .read = generic_file_aio_read,
110 + .write = generic_file_aio_write,
111 .ioctl = shfs_ioctl,
112 .mmap = generic_file_mmap,
113 .open = shfs_file_open,
114 diff -urN shfs-0.35/shfs/Linux-2.6/inode.c shfs-0.35.new/shfs/Linux-2.6/inode.c
115 --- shfs-0.35/shfs/Linux-2.6/inode.c 2004-06-01 15:16:19.000000000 +0200
116 +++ shfs-0.35.new/shfs/Linux-2.6/inode.c 2007-01-11 14:55:21.000000000 +0100
117 @@ -35,7 +35,7 @@
118 shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr)
119 {
120 struct shfs_sb_info *info = info_from_inode(inode);
121 - struct shfs_inode_info *i = inode->u.generic_ip;
122 + struct shfs_inode_info *i = inode->i_private;
123 struct timespec last_time = inode->i_mtime;
124 loff_t last_size = inode->i_size;
125
126 @@ -52,7 +52,6 @@
127 inode->i_ctime = fattr->f_ctime;
128 inode->i_atime = fattr->f_atime;
129 inode->i_mtime = fattr->f_mtime;
130 - inode->i_blksize= fattr->f_blksize;
131 inode->i_blocks = fattr->f_blocks;
132 inode->i_size = fattr->f_size;
133
134 @@ -75,7 +74,7 @@
135 if (!inode)
136 return NULL;
137 inode->i_ino = fattr->f_ino;
138 - i = inode->u.generic_ip = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
139 + i = inode->i_private = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
140 if (!i)
141 return NULL;
142 i->cache = NULL;
143 @@ -107,7 +106,7 @@
144 struct shfs_inode_info *i;
145
146 DEBUG("ino: %lu\n", inode->i_ino);
147 - i = (struct shfs_inode_info *)inode->u.generic_ip;
148 + i = (struct shfs_inode_info *)inode->i_private;
149 if (!i) {
150 VERBOSE("invalid inode\n");
151 goto out;
152 @@ -172,7 +171,7 @@
153 {
154 struct shfs_sb_info *info = info_from_dentry(dentry);
155 struct inode *inode = dentry->d_inode;
156 - struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
157 + struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
158 int result;
159
160 DEBUG("%s\n", dentry->d_name.name);
161 @@ -339,9 +338,9 @@
162
163 static struct super_block *
164 shfs_get_sb(struct file_system_type *fs_type,
165 - int flags, const char *dev_name, void *data)
166 + int flags, const char *dev_name, void *data, struct vfsmount *mnt)
167 {
168 - return get_sb_nodev(fs_type, flags, data, shfs_read_super);
169 + return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
170 }
171
172 static struct file_system_type sh_fs_type = {
173 diff -urN shfs-0.35/shfs/Linux-2.6/proc.c shfs-0.35.new/shfs/Linux-2.6/proc.c
174 --- shfs-0.35/shfs/Linux-2.6/proc.c 2004-06-01 15:16:19.000000000 +0200
175 +++ shfs-0.35.new/shfs/Linux-2.6/proc.c 2007-01-11 14:55:21.000000000 +0100
176 @@ -178,7 +178,7 @@
177
178 vec[0].iov_base = (void *)buffer;
179 vec[0].iov_len = c;
180 - result = f->f_op->writev(f, (const struct iovec *) &vec, 1, &f->f_pos);
181 + result = f->f_op->aio_write(f, (const struct iovec *) &vec, 1, &f->f_pos);
182 if (result < 0) {
183 DEBUG("error: %d\n", result);
184 if (result == -EAGAIN)
185 @@ -261,7 +261,7 @@
186
187 vec[0].iov_base = buffer;
188 vec[0].iov_len = c;
189 - result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
190 + result = f->f_op->aio_read(f, (const struct iovec *)&vec, 1, &f->f_pos);
191 if (!result) {
192 /* peer has closed socket */
193 result = -EIO;
194 @@ -350,7 +350,7 @@
195
196 vec[0].iov_base = BUFFER+LEN;
197 vec[0].iov_len = c;
198 - result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
199 + result = f->f_op->aio_read(f, (const struct iovec *)&vec, 1, &f->f_pos);
200 SIGLOCK(flags);
201 if (result == -EPIPE && !sigpipe) {
202 sigdelset(&current->pending.signal, SIGPIPE);