summary refs log tree commit diff
path: root/pkgs/os-specific/linux/zfs/linux-3.6.patch
blob: c19ec34905d234a9b3e6a5e5d0762efc837a3d7e (plain) (blame)
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-create-nameidata.m4 zfs/config/kernel-create-nameidata.m4
*** zfs-0.60-rc11/config/kernel-create-nameidata.m4	1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-create-nameidata.m4	2012-10-22 10:56:55.016756000 -0700
***************
*** 0 ****
--- 1,26 ----
+ dnl #
+ dnl # 3.6 API change
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
+ 	AC_MSG_CHECKING([whether iops->create() takes struct nameidata])
+ 	ZFS_LINUX_TRY_COMPILE([
+ 		#include <linux/fs.h>
+ 	],[
+ 		#ifdef HAVE_MKDIR_UMODE_T
+ 		int (*inode_create) (struct inode *,struct dentry *,
+ 		                     umode_t, struct nameidata *) = NULL;
+ 		#else
+ 		int (*inode_create) (struct inode *,struct dentry *,
+ 		                     int, struct nameidata *) = NULL;
+ 		#endif
+ 		struct inode_operations iops __attribute__ ((unused)) = {
+ 			.create		= inode_create,
+ 		};
+ 	],[
+ 		AC_MSG_RESULT(yes)
+ 		AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
+ 		          [iops->create() operation takes nameidata])
+ 	],[
+ 		AC_MSG_RESULT(no)
+ 	])
+ ])
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-create-umode-t.m4 zfs/config/kernel-create-umode-t.m4
*** zfs-0.60-rc11/config/kernel-create-umode-t.m4	2012-10-22 10:26:07.080358000 -0700
--- zfs/config/kernel-create-umode-t.m4	1969-12-31 16:00:00.000000000 -0800
***************
*** 1,26 ****
- dnl #
- dnl # 3.3 API change
- dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a
- dnl # umode_t type rather than an int.  The expectation is that any backport
- dnl # would also change all three prototypes.  However, if it turns out that
- dnl # some distribution doesn't backport the whole thing this could be
- dnl # broken apart in to three seperate checks.
- dnl #
- AC_DEFUN([ZFS_AC_KERNEL_CREATE_UMODE_T], [
- 	AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
- 	ZFS_LINUX_TRY_COMPILE([
- 		#include <linux/fs.h>
- 	],[
- 		int (*create) (struct inode *, struct dentry *, umode_t,
- 		    struct nameidata *) = NULL;
- 		struct inode_operations iops __attribute__ ((unused)) = {
- 			.create = create,
- 		};
- 	],[
- 		AC_MSG_RESULT(yes)
- 		AC_DEFINE(HAVE_CREATE_UMODE_T, 1,
- 		    [iops->create()/mkdir()/mknod() take umode_t])
- 	],[
- 		AC_MSG_RESULT(no)
- 	])
- ])
--- 0 ----
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-lookup-nameidata.m4 zfs/config/kernel-lookup-nameidata.m4
*** zfs-0.60-rc11/config/kernel-lookup-nameidata.m4	1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-lookup-nameidata.m4	2012-10-22 10:56:55.017130000 -0700
***************
*** 0 ****
--- 1,21 ----
+ dnl #
+ dnl # 3.6 API change
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
+ 	AC_MSG_CHECKING([whether iops->lookup() takes struct nameidata])
+ 	ZFS_LINUX_TRY_COMPILE([
+ 		#include <linux/fs.h>
+ 	],[
+ 		struct dentry * (*inode_lookup) (struct inode *,struct dentry *,
+ 		                     struct nameidata *) = NULL;
+ 		struct inode_operations iops __attribute__ ((unused)) = {
+ 			.lookup		= inode_lookup,
+ 		};
+ 	],[
+ 		AC_MSG_RESULT(yes)
+ 		AC_DEFINE(HAVE_LOOKUP_NAMEIDATA, 1,
+ 		          [iops->lookup() operation takes nameidata])
+ 	],[
+ 		AC_MSG_RESULT(no)
+ 	])
+ ])
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel.m4 zfs/config/kernel.m4
*** zfs-0.60-rc11/config/kernel.m4	2012-10-22 10:26:07.082539000 -0700
--- zfs/config/kernel.m4	2012-10-22 10:57:19.052391000 -0700
***************
*** 49,56 ****
  	ZFS_AC_KERNEL_NR_CACHED_OBJECTS
  	ZFS_AC_KERNEL_FREE_CACHED_OBJECTS
  	ZFS_AC_KERNEL_FALLOCATE
  	ZFS_AC_KERNEL_TRUNCATE_RANGE
- 	ZFS_AC_KERNEL_CREATE_UMODE_T
  	ZFS_AC_KERNEL_AUTOMOUNT
  	ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
  	ZFS_AC_KERNEL_CLEAR_INODE
--- 49,58 ----
  	ZFS_AC_KERNEL_NR_CACHED_OBJECTS
  	ZFS_AC_KERNEL_FREE_CACHED_OBJECTS
  	ZFS_AC_KERNEL_FALLOCATE
+ 	ZFS_AC_KERNEL_MKDIR_UMODE_T
+ 	ZFS_AC_KERNEL_LOOKUP_NAMEIDATA
+ 	ZFS_AC_KERNEL_CREATE_NAMEIDATA
  	ZFS_AC_KERNEL_TRUNCATE_RANGE
  	ZFS_AC_KERNEL_AUTOMOUNT
  	ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
  	ZFS_AC_KERNEL_CLEAR_INODE
***************
*** 66,71 ****
--- 68,74 ----
  	ZFS_AC_KERNEL_BDI
  	ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER
  	ZFS_AC_KERNEL_SET_NLINK
+  	ZFS_AC_KERNEL_5ARG_SGET
  
  	AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
  		KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-mkdir-umode-t.m4 zfs/config/kernel-mkdir-umode-t.m4
*** zfs-0.60-rc11/config/kernel-mkdir-umode-t.m4	1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-mkdir-umode-t.m4	2012-10-22 10:56:55.017271000 -0700
***************
*** 0 ****
--- 1,25 ----
+ dnl #
+ dnl # 3.3 API change
+ dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a
+ dnl # umode_t type rather than an int.  The expectation is that any backport
+ dnl # would also change all three prototypes.  However, if it turns out that
+ dnl # some distribution doesn't backport the whole thing this could be
+ dnl # broken apart in to three seperate checks.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [
+ 	AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
+ 	ZFS_LINUX_TRY_COMPILE([
+ 		#include <linux/fs.h>
+ 	],[
+ 		int (*mkdir) (struct inode *,struct dentry *,umode_t) = NULL;
+ 		struct inode_operations iops __attribute__ ((unused)) = {
+ 			.mkdir = mkdir,
+ 		};
+ 	],[
+ 		AC_MSG_RESULT(yes)
+ 		AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
+ 		    [iops->create()/mkdir()/mknod() take umode_t])
+ 	],[
+ 		AC_MSG_RESULT(no)
+ 	])
+ ])
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-sget-args.m4 zfs/config/kernel-sget-args.m4
*** zfs-0.60-rc11/config/kernel-sget-args.m4	1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-sget-args.m4	2012-10-22 10:56:55.017404000 -0700
***************
*** 0 ****
--- 1,23 ----
+ dnl #
+ dnl # 3.6 API change,
+ dnl # 'sget' now takes the mount flags as an argument.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_5ARG_SGET],
+ 	[AC_MSG_CHECKING([whether sget() wants 5 args])
+ 	ZFS_LINUX_TRY_COMPILE([
+ 		#include <linux/fs.h>
+ 	],[
+ 		struct file_system_type *type = NULL;
+ 		int (*test)(struct super_block *,void *) = NULL;
+ 		int (*set)(struct super_block *,void *) = NULL;
+ 		int flags = 0;
+ 		void *data = NULL;
+ 		(void) sget(type, test, set, flags, data);
+ 	],[
+ 		AC_MSG_RESULT(yes)
+ 		AC_DEFINE(HAVE_5ARG_SGET, 1, [sget() wants 5 args])
+ 	],[
+ 		AC_MSG_RESULT(no)
+ 	])
+ ])
+ 
diff -crN '--exclude=.git' zfs-0.60-rc11/include/linux/vfs_compat.h zfs/include/linux/vfs_compat.h
*** zfs-0.60-rc11/include/linux/vfs_compat.h	2012-10-22 10:26:07.087810000 -0700
--- zfs/include/linux/vfs_compat.h	2012-10-22 10:56:55.018213000 -0700
***************
*** 115,121 ****
   * umode_t type rather than an int.  To cleanly handle both definitions
   * the zpl_umode_t type is introduced and set accordingly.
   */
! #ifdef HAVE_CREATE_UMODE_T
  typedef	umode_t		zpl_umode_t;
  #else
  typedef	int		zpl_umode_t;
--- 115,121 ----
   * umode_t type rather than an int.  To cleanly handle both definitions
   * the zpl_umode_t type is introduced and set accordingly.
   */
! #ifdef HAVE_MKDIR_UMODE_T
  typedef	umode_t		zpl_umode_t;
  #else
  typedef	int		zpl_umode_t;
***************
*** 131,134 ****
--- 131,144 ----
  #define clear_inode(ip)		end_writeback(ip)
  #endif /* HAVE_EVICT_INODE && !HAVE_CLEAR_INODE */
  
+ /*
+  * 3.6 API change,
+  * The sget() helper function now takes the mount flags as an argument.
+  */
+ #ifdef HAVE_5ARG_SGET
+ #define zpl_sget(type, cmp, set, fl, mtd)	sget(type, cmp, set, fl, mtd)
+ #else
+ #define zpl_sget(type, cmp, set, fl, mtd)	sget(type, cmp, set, mtd)
+ #endif /* HAVE_5ARG_SGET */
+ 
  #endif /* _ZFS_VFS_H */
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zfs_ctldir.c zfs/module/zfs/zfs_ctldir.c
*** zfs-0.60-rc11/module/zfs/zfs_ctldir.c	2012-10-22 10:26:07.149142000 -0700
--- zfs/module/zfs/zfs_ctldir.c	2012-10-22 10:56:55.018581000 -0700
***************
*** 920,927 ****
  		 * race cannot occur to an expired mount point because
  		 * we hold the zsb->z_ctldir_lock to prevent the race.
  		 */
! 		sbp = sget(&zpl_fs_type, zfsctl_test_super,
! 		    zfsctl_set_super, &id);
  		if (IS_ERR(sbp)) {
  			error = -PTR_ERR(sbp);
  		} else {
--- 920,927 ----
  		 * race cannot occur to an expired mount point because
  		 * we hold the zsb->z_ctldir_lock to prevent the race.
  		 */
! 		sbp = zpl_sget(&zpl_fs_type, zfsctl_test_super,
! 		    zfsctl_set_super, 0, &id);
  		if (IS_ERR(sbp)) {
  			error = -PTR_ERR(sbp);
  		} else {
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zpl_ctldir.c zfs/module/zfs/zpl_ctldir.c
*** zfs-0.60-rc11/module/zfs/zpl_ctldir.c	2012-10-22 10:26:07.156116000 -0700
--- zfs/module/zfs/zpl_ctldir.c	2012-10-22 10:56:55.018882000 -0700
***************
*** 143,149 ****
--- 143,153 ----
  }
  
  static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
  zpl_root_lookup(struct inode *dip, struct dentry *dentry, struct nameidata *nd)
+ #else
+ zpl_root_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags)
+ #endif
  {
  	cred_t *cr = CRED();
  	struct inode *ip;
***************
*** 180,187 ****
--- 184,197 ----
  };
  
  static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
  zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry,
      struct nameidata *nd)
+ #else
+ zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry,
+     unsigned int flags)
+ #endif
+ 
  {
  	cred_t *cr = CRED();
  	struct inode *ip;
***************
*** 410,417 ****
--- 420,432 ----
  #endif /* HAVE_AUTOMOUNT */
  
  static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
  zpl_shares_lookup(struct inode *dip, struct dentry *dentry,
      struct nameidata *nd)
+ #else
+ zpl_shares_lookup(struct inode *dip, struct dentry *dentry,
+     unsigned int flags)
+ #endif
  {
  	cred_t *cr = CRED();
  	struct inode *ip = NULL;
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zpl_inode.c zfs/module/zfs/zpl_inode.c
*** zfs-0.60-rc11/module/zfs/zpl_inode.c	2012-10-22 10:26:07.156492000 -0700
--- zfs/module/zfs/zpl_inode.c	2012-10-22 10:56:55.019152000 -0700
***************
*** 31,37 ****
--- 31,41 ----
  
  
  static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
  zpl_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
+ #else
+ zpl_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
+ #endif
  {
  	cred_t *cr = CRED();
  	struct inode *ip;
***************
*** 71,78 ****
--- 75,87 ----
  }
  
  static int
+ #ifdef HAVE_CREATE_NAMEIDATA
  zpl_create(struct inode *dir, struct dentry *dentry, zpl_umode_t mode,
      struct nameidata *nd)
+ #else
+ zpl_create(struct inode *dir, struct dentry *dentry, zpl_umode_t mode,
+     bool flag)
+ #endif
  {
  	cred_t *cr = CRED();
  	struct inode *ip;
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zpl_super.c zfs/module/zfs/zpl_super.c
*** zfs-0.60-rc11/module/zfs/zpl_super.c	2012-10-22 10:26:07.156616000 -0700
--- zfs/module/zfs/zpl_super.c	2012-10-22 10:56:55.019421000 -0700
***************
*** 316,322 ****
  	.delete_inode		= zpl_inode_delete,
  #endif /* HAVE_EVICT_INODE */
  	.put_super		= zpl_put_super,
- 	.write_super		= NULL,
  	.sync_fs		= zpl_sync_fs,
  	.statfs			= zpl_statfs,
  	.remount_fs		= zpl_remount_fs,
--- 316,321 ----