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