1 --- linux-3.0/fs/aufs/dynop.c 2011-08-24 12:17:44.788277908 +0200
2 +++ linux-3.0/fs/aufs/dynop.c 2011-08-24 12:11:22.375748361 +0200
4 #define DySet(func, dst, src, h_op, h_sb) do { \
8 - dst.func = src.func; \
11 + pax_open_kernel(); \
12 + *(void **)&dst.func = src.func; \
13 + pax_close_kernel(); \
15 AuDbg("%s %s\n", au_sbtype(h_sb), #func); \
19 #define DySetForce(func, dst, src) do { \
20 AuDebugOn(!src.func); \
22 - dst.func = src.func; \
23 + pax_open_kernel(); \
24 + *(void **)&dst.func = src.func; \
25 + pax_close_kernel(); \
28 #define DySetAop(func) \
31 static void dy_adx(struct au_dyaop *dyaop, int do_dx)
35 - dyaop->da_op.direct_IO = NULL;
36 - dyaop->da_op.get_xip_mem = NULL;
37 + *(void **)&dyaop->da_op.direct_IO = NULL;
38 + *(void **)&dyaop->da_op.get_xip_mem = NULL;
40 - dyaop->da_op.direct_IO = aufs_aop.direct_IO;
41 - dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
42 + *(void **)&dyaop->da_op.direct_IO = aufs_aop.direct_IO;
43 + *(void **)&dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
44 if (!dyaop->da_get_xip_mem)
45 - dyaop->da_op.get_xip_mem = NULL;
46 + *(void **)&dyaop->da_op.get_xip_mem = NULL;
51 static struct au_dyaop *dy_aget(struct au_branch *br,
52 --- linux-3.0/include/linux/fsnotify_backend.h~ 2011-07-22 04:17:23.000000000 +0200
53 +++ linux-3.0/include/linux/fsnotify_backend.h 2011-08-24 13:39:25.587741912 +0200
54 @@ -105,6 +105,7 @@ struct fsnotify_ops {
55 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group);
56 void (*free_event_priv)(struct fsnotify_event_private_data *priv);
58 +typedef struct fsnotify_ops __no_const fsnotify_ops_no_const;
61 * A group is a "thing" that wants to receive notification about filesystem
62 --- linux-3.0/fs/aufs/branch.h.org 2011-08-24 13:39:47.194932184 +0200
63 +++ linux-3.0/fs/aufs/branch.h 2011-08-24 13:39:53.691756219 +0200
64 @@ -83,7 +83,7 @@ struct au_branch {
66 #ifdef CONFIG_AUFS_HFSNOTIFY
67 struct fsnotify_group *br_hfsn_group;
68 - struct fsnotify_ops br_hfsn_ops;
69 + fsnotify_ops_no_const br_hfsn_ops;
73 --- linux-3.0/fs/aufs/f_op_sp.c~ 2011-08-24 14:41:55.000000000 +0200
74 +++ linux-3.0/fs/aufs/f_op_sp.c 2011-08-24 14:54:22.072544774 +0200
76 static int aufs_open_sp(struct inode *inode, struct file *file);
77 static struct au_sp_fop {
79 - struct file_operations fop; /* not 'const' */
80 + file_operations_no_const fop; /* not 'const' */
82 } au_sp_fop[AuSp_Last] = {
84 @@ -161,7 +161,9 @@ static void au_init_fop_sp(struct file *
85 h_file = au_hf_top(file);
88 - p->fop = *h_file->f_op;
90 + memcpy((void *)&p->fop, h_file->f_op, sizeof(p->fop));
91 p->fop.owner = THIS_MODULE;
94 p->fop.aio_read = aufs_aio_read_sp;