Commit 8e18e2941c53416aa219708e7dcad21fb4bd6794

Authored by Theodore Ts'o
Committed by Linus Torvalds
1 parent 6a1d9805ec

[PATCH] inode_diet: Replace inode.u.generic_ip with inode.i_private

The following patches reduce the size of the VFS inode structure by 28 bytes
on a UP x86.  (It would be more on an x86_64 system).  This is a 10% reduction
in the inode size on a UP kernel that is configured in a production mode
(i.e., with no spinlock or other debugging functions enabled; if you want to
save memory taken up by in-core inodes, the first thing you should do is
disable the debugging options; they are responsible for a huge amount of bloat
in the VFS inode structure).

This patch:

The filesystem or device-specific pointer in the inode is inside a union,
which is pretty pointless given that all 30+ users of this field have been
using the void pointer.  Get rid of the union and rename it to i_private, with
a comment to explain who is allowed to use the void pointer.  This is just a
cleanup, but it allows us to reuse the union 'u' for something something where
the union will actually be used.

[judith@osdl.org: powerpc build fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Judith Lebzelter <judith@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 36 changed files with 88 additions and 90 deletions Side-by-side Diff

arch/powerpc/platforms/cell/spufs/inode.c
... ... @@ -120,7 +120,7 @@
120 120 ret = 0;
121 121 inode->i_op = &spufs_file_iops;
122 122 inode->i_fop = fops;
123   - inode->u.generic_ip = SPUFS_I(inode)->i_ctx = get_spu_context(ctx);
  123 + inode->i_private = SPUFS_I(inode)->i_ctx = get_spu_context(ctx);
124 124 d_add(dentry, inode);
125 125 out:
126 126 return ret;
arch/powerpc/platforms/pseries/hvCall_inst.c
... ... @@ -85,7 +85,7 @@
85 85  
86 86 rc = seq_open(file, &hcall_inst_seq_ops);
87 87 seq = file->private_data;
88   - seq->private = file->f_dentry->d_inode->u.generic_ip;
  88 + seq->private = file->f_dentry->d_inode->i_private;
89 89  
90 90 return rc;
91 91 }
arch/s390/hypfs/inode.c
... ... @@ -104,13 +104,13 @@
104 104  
105 105 static void hypfs_drop_inode(struct inode *inode)
106 106 {
107   - kfree(inode->u.generic_ip);
  107 + kfree(inode->i_private);
108 108 generic_delete_inode(inode);
109 109 }
110 110  
111 111 static int hypfs_open(struct inode *inode, struct file *filp)
112 112 {
113   - char *data = filp->f_dentry->d_inode->u.generic_ip;
  113 + char *data = filp->f_dentry->d_inode->i_private;
114 114 struct hypfs_sb_info *fs_info;
115 115  
116 116 if (filp->f_mode & FMODE_WRITE) {
... ... @@ -352,7 +352,7 @@
352 352 parent->d_inode->i_nlink++;
353 353 } else
354 354 BUG();
355   - inode->u.generic_ip = data;
  355 + inode->i_private = data;
356 356 d_instantiate(dentry, inode);
357 357 dget(dentry);
358 358 return dentry;
arch/s390/kernel/debug.c
... ... @@ -603,7 +603,7 @@
603 603 debug_info_t *debug_info, *debug_info_snapshot;
604 604  
605 605 down(&debug_lock);
606   - debug_info = (struct debug_info*)file->f_dentry->d_inode->u.generic_ip;
  606 + debug_info = file->f_dentry->d_inode->i_private;
607 607 /* find debug view */
608 608 for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
609 609 if (!debug_info->views[i])
... ... @@ -217,7 +217,7 @@
217 217  
218 218 static int blk_dropped_open(struct inode *inode, struct file *filp)
219 219 {
220   - filp->private_data = inode->u.generic_ip;
  220 + filp->private_data = inode->i_private;
221 221  
222 222 return 0;
223 223 }
drivers/i2c/chips/tps65010.c
... ... @@ -305,7 +305,7 @@
305 305  
306 306 static int dbg_tps_open(struct inode *inode, struct file *file)
307 307 {
308   - return single_open(file, dbg_show, inode->u.generic_ip);
  308 + return single_open(file, dbg_show, inode->i_private);
309 309 }
310 310  
311 311 static struct file_operations debug_fops = {
drivers/infiniband/hw/ipath/ipath_fs.c
... ... @@ -64,7 +64,7 @@
64 64 inode->i_blksize = PAGE_CACHE_SIZE;
65 65 inode->i_blocks = 0;
66 66 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
67   - inode->u.generic_ip = data;
  67 + inode->i_private = data;
68 68 if ((mode & S_IFMT) == S_IFDIR) {
69 69 inode->i_op = &simple_dir_inode_operations;
70 70 inode->i_nlink++;
... ... @@ -119,7 +119,7 @@
119 119 u16 i;
120 120 struct ipath_devdata *dd;
121 121  
122   - dd = file->f_dentry->d_inode->u.generic_ip;
  122 + dd = file->f_dentry->d_inode->i_private;
123 123  
124 124 for (i = 0; i < NUM_COUNTERS; i++)
125 125 counters[i] = ipath_snap_cntr(dd, i);
... ... @@ -139,7 +139,7 @@
139 139 struct ipath_devdata *dd;
140 140 u64 guid;
141 141  
142   - dd = file->f_dentry->d_inode->u.generic_ip;
  142 + dd = file->f_dentry->d_inode->i_private;
143 143  
144 144 guid = be64_to_cpu(dd->ipath_guid);
145 145  
... ... @@ -178,7 +178,7 @@
178 178 u32 tmp, tmp2;
179 179 struct ipath_devdata *dd;
180 180  
181   - dd = file->f_dentry->d_inode->u.generic_ip;
  181 + dd = file->f_dentry->d_inode->i_private;
182 182  
183 183 /* so we only initialize non-zero fields. */
184 184 memset(portinfo, 0, sizeof portinfo);
... ... @@ -325,7 +325,7 @@
325 325 goto bail;
326 326 }
327 327  
328   - dd = file->f_dentry->d_inode->u.generic_ip;
  328 + dd = file->f_dentry->d_inode->i_private;
329 329 if (ipath_eeprom_read(dd, pos, tmp, count)) {
330 330 ipath_dev_err(dd, "failed to read from flash\n");
331 331 ret = -ENXIO;
... ... @@ -381,7 +381,7 @@
381 381 goto bail_tmp;
382 382 }
383 383  
384   - dd = file->f_dentry->d_inode->u.generic_ip;
  384 + dd = file->f_dentry->d_inode->i_private;
385 385 if (ipath_eeprom_write(dd, pos, tmp, count)) {
386 386 ret = -ENXIO;
387 387 ipath_dev_err(dd, "failed to write to flash\n");
drivers/infiniband/ulp/ipoib/ipoib_fs.c
... ... @@ -141,7 +141,7 @@
141 141 return ret;
142 142  
143 143 seq = file->private_data;
144   - seq->private = inode->u.generic_ip;
  144 + seq->private = inode->i_private;
145 145  
146 146 return 0;
147 147 }
... ... @@ -247,7 +247,7 @@
247 247 return ret;
248 248  
249 249 seq = file->private_data;
250   - seq->private = inode->u.generic_ip;
  250 + seq->private = inode->i_private;
251 251  
252 252 return 0;
253 253 }
drivers/misc/ibmasm/ibmasmfs.c
... ... @@ -175,7 +175,7 @@
175 175 }
176 176  
177 177 inode->i_fop = fops;
178   - inode->u.generic_ip = data;
  178 + inode->i_private = data;
179 179  
180 180 d_add(dentry, inode);
181 181 return dentry;
... ... @@ -244,7 +244,7 @@
244 244 {
245 245 struct ibmasmfs_command_data *command_data;
246 246  
247   - if (!inode->u.generic_ip)
  247 + if (!inode->i_private)
248 248 return -ENODEV;
249 249  
250 250 command_data = kmalloc(sizeof(struct ibmasmfs_command_data), GFP_KERNEL);
... ... @@ -252,7 +252,7 @@
252 252 return -ENOMEM;
253 253  
254 254 command_data->command = NULL;
255   - command_data->sp = inode->u.generic_ip;
  255 + command_data->sp = inode->i_private;
256 256 file->private_data = command_data;
257 257 return 0;
258 258 }
259 259  
... ... @@ -351,10 +351,10 @@
351 351 struct ibmasmfs_event_data *event_data;
352 352 struct service_processor *sp;
353 353  
354   - if (!inode->u.generic_ip)
  354 + if (!inode->i_private)
355 355 return -ENODEV;
356 356  
357   - sp = inode->u.generic_ip;
  357 + sp = inode->i_private;
358 358  
359 359 event_data = kmalloc(sizeof(struct ibmasmfs_event_data), GFP_KERNEL);
360 360 if (!event_data)
361 361  
... ... @@ -439,14 +439,14 @@
439 439 {
440 440 struct ibmasmfs_heartbeat_data *rhbeat;
441 441  
442   - if (!inode->u.generic_ip)
  442 + if (!inode->i_private)
443 443 return -ENODEV;
444 444  
445 445 rhbeat = kmalloc(sizeof(struct ibmasmfs_heartbeat_data), GFP_KERNEL);
446 446 if (!rhbeat)
447 447 return -ENOMEM;
448 448  
449   - rhbeat->sp = (struct service_processor *)inode->u.generic_ip;
  449 + rhbeat->sp = inode->i_private;
450 450 rhbeat->active = 0;
451 451 ibmasm_init_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat);
452 452 file->private_data = rhbeat;
... ... @@ -508,7 +508,7 @@
508 508  
509 509 static int remote_settings_file_open(struct inode *inode, struct file *file)
510 510 {
511   - file->private_data = inode->u.generic_ip;
  511 + file->private_data = inode->i_private;
512 512 return 0;
513 513 }
514 514  
drivers/net/irda/vlsi_ir.h
... ... @@ -58,7 +58,7 @@
58 58  
59 59 /* PDE() introduced in 2.5.4 */
60 60 #ifdef CONFIG_PROC_FS
61   -#define PDE(inode) ((inode)->u.generic_ip)
  61 +#define PDE(inode) ((inode)->i_private)
62 62 #endif
63 63  
64 64 /* irda crc16 calculation exported in 2.5.42 */
drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
... ... @@ -54,7 +54,7 @@
54 54  
55 55 static int open_file_generic(struct inode *inode, struct file *file)
56 56 {
57   - file->private_data = inode->u.generic_ip;
  57 + file->private_data = inode->i_private;
58 58 return 0;
59 59 }
60 60  
drivers/oprofile/oprofilefs.c
... ... @@ -110,8 +110,8 @@
110 110  
111 111 static int default_open(struct inode * inode, struct file * filp)
112 112 {
113   - if (inode->u.generic_ip)
114   - filp->private_data = inode->u.generic_ip;
  113 + if (inode->i_private)
  114 + filp->private_data = inode->i_private;
115 115 return 0;
116 116 }
117 117  
... ... @@ -158,7 +158,7 @@
158 158 if (!d)
159 159 return -EFAULT;
160 160  
161   - d->d_inode->u.generic_ip = val;
  161 + d->d_inode->i_private = val;
162 162 return 0;
163 163 }
164 164  
... ... @@ -171,7 +171,7 @@
171 171 if (!d)
172 172 return -EFAULT;
173 173  
174   - d->d_inode->u.generic_ip = val;
  174 + d->d_inode->i_private = val;
175 175 return 0;
176 176 }
177 177  
... ... @@ -197,7 +197,7 @@
197 197 if (!d)
198 198 return -EFAULT;
199 199  
200   - d->d_inode->u.generic_ip = val;
  200 + d->d_inode->i_private = val;
201 201 return 0;
202 202 }
203 203  
drivers/pci/hotplug/cpqphp_sysfs.c
... ... @@ -140,7 +140,7 @@
140 140  
141 141 static int open(struct inode *inode, struct file *file)
142 142 {
143   - struct controller *ctrl = inode->u.generic_ip;
  143 + struct controller *ctrl = inode->i_private;
144 144 struct ctrl_dbg *dbg;
145 145 int retval = -ENOMEM;
146 146  
drivers/usb/core/devio.c
... ... @@ -555,7 +555,7 @@
555 555 if (imajor(inode) == USB_DEVICE_MAJOR)
556 556 dev = usbdev_lookup_minor(iminor(inode));
557 557 if (!dev)
558   - dev = inode->u.generic_ip;
  558 + dev = inode->i_private;
559 559 if (!dev) {
560 560 kfree(ps);
561 561 goto out;
drivers/usb/core/inode.c
... ... @@ -402,8 +402,8 @@
402 402  
403 403 static int default_open (struct inode *inode, struct file *file)
404 404 {
405   - if (inode->u.generic_ip)
406   - file->private_data = inode->u.generic_ip;
  405 + if (inode->i_private)
  406 + file->private_data = inode->i_private;
407 407  
408 408 return 0;
409 409 }
... ... @@ -509,7 +509,7 @@
509 509 } else {
510 510 if (dentry->d_inode) {
511 511 if (data)
512   - dentry->d_inode->u.generic_ip = data;
  512 + dentry->d_inode->i_private = data;
513 513 if (fops)
514 514 dentry->d_inode->i_fop = fops;
515 515 dentry->d_inode->i_uid = uid;
drivers/usb/gadget/inode.c
... ... @@ -844,7 +844,7 @@
844 844 static int
845 845 ep_open (struct inode *inode, struct file *fd)
846 846 {
847   - struct ep_data *data = inode->u.generic_ip;
  847 + struct ep_data *data = inode->i_private;
848 848 int value = -EBUSY;
849 849  
850 850 if (down_interruptible (&data->lock) != 0)
... ... @@ -1909,7 +1909,7 @@
1909 1909 static int
1910 1910 dev_open (struct inode *inode, struct file *fd)
1911 1911 {
1912   - struct dev_data *dev = inode->u.generic_ip;
  1912 + struct dev_data *dev = inode->i_private;
1913 1913 int value = -EBUSY;
1914 1914  
1915 1915 if (dev->state == STATE_DEV_DISABLED) {
... ... @@ -1970,7 +1970,7 @@
1970 1970 inode->i_blocks = 0;
1971 1971 inode->i_atime = inode->i_mtime = inode->i_ctime
1972 1972 = CURRENT_TIME;
1973   - inode->u.generic_ip = data;
  1973 + inode->i_private = data;
1974 1974 inode->i_fop = fops;
1975 1975 }
1976 1976 return inode;
drivers/usb/host/isp116x-hcd.c
... ... @@ -1204,7 +1204,7 @@
1204 1204  
1205 1205 static int isp116x_open_seq(struct inode *inode, struct file *file)
1206 1206 {
1207   - return single_open(file, isp116x_show_dbg, inode->u.generic_ip);
  1207 + return single_open(file, isp116x_show_dbg, inode->i_private);
1208 1208 }
1209 1209  
1210 1210 static struct file_operations isp116x_debug_fops = {
drivers/usb/host/uhci-debug.c
... ... @@ -428,7 +428,7 @@
428 428  
429 429 static int uhci_debug_open(struct inode *inode, struct file *file)
430 430 {
431   - struct uhci_hcd *uhci = inode->u.generic_ip;
  431 + struct uhci_hcd *uhci = inode->i_private;
432 432 struct uhci_debug *up;
433 433 int ret = -ENOMEM;
434 434 unsigned long flags;
drivers/usb/mon/mon_stat.c
... ... @@ -28,7 +28,7 @@
28 28 if ((sp = kmalloc(sizeof(struct snap), GFP_KERNEL)) == NULL)
29 29 return -ENOMEM;
30 30  
31   - mbus = inode->u.generic_ip;
  31 + mbus = inode->i_private;
32 32  
33 33 sp->slen = snprintf(sp->str, STAT_BUF_SIZE,
34 34 "nreaders %d events %u text_lost %u\n",
drivers/usb/mon/mon_text.c
... ... @@ -238,7 +238,7 @@
238 238 int rc;
239 239  
240 240 mutex_lock(&mon_lock);
241   - mbus = inode->u.generic_ip;
  241 + mbus = inode->i_private;
242 242 ubus = mbus->u_bus;
243 243  
244 244 rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL);
... ... @@ -401,7 +401,7 @@
401 401 struct mon_event_text *ep;
402 402  
403 403 mutex_lock(&mon_lock);
404   - mbus = inode->u.generic_ip;
  404 + mbus = inode->i_private;
405 405  
406 406 if (mbus->nreaders <= 0) {
407 407 printk(KERN_ERR TAG ": consistency error on close\n");
... ... @@ -241,7 +241,7 @@
241 241  
242 242 inode->i_op = &autofs_symlink_inode_operations;
243 243 sl = &sbi->symlink[n];
244   - inode->u.generic_ip = sl;
  244 + inode->i_private = sl;
245 245 inode->i_mode = S_IFLNK | S_IRWXUGO;
246 246 inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = sl->mtime;
247 247 inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0;
... ... @@ -15,7 +15,7 @@
15 15 /* Nothing to release.. */
16 16 static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd)
17 17 {
18   - char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data;
  18 + char *s=((struct autofs_symlink *)dentry->d_inode->i_private)->data;
19 19 nd_set_link(nd, s);
20 20 return NULL;
21 21 }
... ... @@ -517,7 +517,7 @@
517 517  
518 518 static void bm_clear_inode(struct inode *inode)
519 519 {
520   - kfree(inode->u.generic_ip);
  520 + kfree(inode->i_private);
521 521 }
522 522  
523 523 static void kill_node(Node *e)
... ... @@ -545,7 +545,7 @@
545 545 static ssize_t
546 546 bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)
547 547 {
548   - Node *e = file->f_dentry->d_inode->u.generic_ip;
  548 + Node *e = file->f_dentry->d_inode->i_private;
549 549 loff_t pos = *ppos;
550 550 ssize_t res;
551 551 char *page;
... ... @@ -579,7 +579,7 @@
579 579 size_t count, loff_t *ppos)
580 580 {
581 581 struct dentry *root;
582   - Node *e = file->f_dentry->d_inode->u.generic_ip;
  582 + Node *e = file->f_dentry->d_inode->i_private;
583 583 int res = parse_command(buffer, count);
584 584  
585 585 switch (res) {
... ... @@ -646,7 +646,7 @@
646 646 }
647 647  
648 648 e->dentry = dget(dentry);
649   - inode->u.generic_ip = e;
  649 + inode->i_private = e;
650 650 inode->i_fop = &bm_entry_operations;
651 651  
652 652 d_instantiate(dentry, inode);
... ... @@ -32,8 +32,8 @@
32 32  
33 33 static int default_open(struct inode *inode, struct file *file)
34 34 {
35   - if (inode->u.generic_ip)
36   - file->private_data = inode->u.generic_ip;
  35 + if (inode->i_private)
  36 + file->private_data = inode->i_private;
37 37  
38 38 return 0;
39 39 }
... ... @@ -168,7 +168,7 @@
168 168 * directory dentry if set. If this paramater is NULL, then the
169 169 * file will be created in the root of the debugfs filesystem.
170 170 * @data: a pointer to something that the caller will want to get to later
171   - * on. The inode.u.generic_ip pointer will point to this value on
  171 + * on. The inode.i_private pointer will point to this value on
172 172 * the open() call.
173 173 * @fops: a pointer to a struct file_operations that should be used for
174 174 * this file.
... ... @@ -209,7 +209,7 @@
209 209  
210 210 if (dentry->d_inode) {
211 211 if (data)
212   - dentry->d_inode->u.generic_ip = data;
  212 + dentry->d_inode->i_private = data;
213 213 if (fops)
214 214 dentry->d_inode->i_fop = fops;
215 215 }
... ... @@ -177,7 +177,7 @@
177 177 inode->i_gid = config.setgid ? config.gid : current->fsgid;
178 178 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
179 179 init_special_inode(inode, S_IFCHR|config.mode, device);
180   - inode->u.generic_ip = tty;
  180 + inode->i_private = tty;
181 181  
182 182 dentry = get_node(number);
183 183 if (!IS_ERR(dentry) && !dentry->d_inode)
... ... @@ -196,7 +196,7 @@
196 196 tty = NULL;
197 197 if (!IS_ERR(dentry)) {
198 198 if (dentry->d_inode)
199   - tty = dentry->d_inode->u.generic_ip;
  199 + tty = dentry->d_inode->i_private;
200 200 dput(dentry);
201 201 }
202 202  
... ... @@ -252,7 +252,7 @@
252 252 * Get filesystem private data from VFS inode.
253 253 */
254 254 #define VXFS_INO(ip) \
255   - ((struct vxfs_inode_info *)(ip)->u.generic_ip)
  255 + ((struct vxfs_inode_info *)(ip)->i_private)
256 256  
257 257 /*
258 258 * Get filesystem private data from VFS superblock.
fs/freevxfs/vxfs_inode.c
... ... @@ -243,7 +243,7 @@
243 243 ip->i_blocks = vip->vii_blocks;
244 244 ip->i_generation = vip->vii_gen;
245 245  
246   - ip->u.generic_ip = (void *)vip;
  246 + ip->i_private = vip;
247 247  
248 248 }
249 249  
... ... @@ -338,6 +338,6 @@
338 338 void
339 339 vxfs_clear_inode(struct inode *ip)
340 340 {
341   - kmem_cache_free(vxfs_inode_cachep, ip->u.generic_ip);
  341 + kmem_cache_free(vxfs_inode_cachep, ip->i_private);
342 342 }
... ... @@ -23,7 +23,7 @@
23 23 {
24 24 struct fuse_conn *fc;
25 25 mutex_lock(&fuse_mutex);
26   - fc = file->f_dentry->d_inode->u.generic_ip;
  26 + fc = file->f_dentry->d_inode->i_private;
27 27 if (fc)
28 28 fc = fuse_conn_get(fc);
29 29 mutex_unlock(&fuse_mutex);
... ... @@ -98,7 +98,7 @@
98 98 inode->i_op = iop;
99 99 inode->i_fop = fop;
100 100 inode->i_nlink = nlink;
101   - inode->u.generic_ip = fc;
  101 + inode->i_private = fc;
102 102 d_add(dentry, inode);
103 103 return dentry;
104 104 }
... ... @@ -150,7 +150,7 @@
150 150  
151 151 for (i = fc->ctl_ndents - 1; i >= 0; i--) {
152 152 struct dentry *dentry = fc->ctl_dentry[i];
153   - dentry->d_inode->u.generic_ip = NULL;
  153 + dentry->d_inode->i_private = NULL;
154 154 d_drop(dentry);
155 155 dput(dentry);
156 156 }
... ... @@ -163,7 +163,7 @@
163 163 bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
164 164 mapping->backing_dev_info = bdi;
165 165 }
166   - memset(&inode->u, 0, sizeof(inode->u));
  166 + inode->i_private = 0;
167 167 inode->i_mapping = mapping;
168 168 }
169 169 return inode;
... ... @@ -369,7 +369,7 @@
369 369  
370 370 f = jffs_find_file(c, raw_inode->ino);
371 371  
372   - inode->u.generic_ip = (void *)f;
  372 + inode->i_private = (void *)f;
373 373 insert_inode_hash(inode);
374 374  
375 375 return inode;
... ... @@ -442,7 +442,7 @@
442 442 });
443 443  
444 444 result = -ENOTDIR;
445   - if (!(old_dir_f = (struct jffs_file *)old_dir->u.generic_ip)) {
  445 + if (!(old_dir_f = old_dir->i_private)) {
446 446 D(printk("jffs_rename(): Old dir invalid.\n"));
447 447 goto jffs_rename_end;
448 448 }
... ... @@ -456,7 +456,7 @@
456 456  
457 457 /* Find the new directory. */
458 458 result = -ENOTDIR;
459   - if (!(new_dir_f = (struct jffs_file *)new_dir->u.generic_ip)) {
  459 + if (!(new_dir_f = new_dir->i_private)) {
460 460 D(printk("jffs_rename(): New dir invalid.\n"));
461 461 goto jffs_rename_end;
462 462 }
... ... @@ -593,7 +593,7 @@
593 593 }
594 594 else {
595 595 ddino = ((struct jffs_file *)
596   - inode->u.generic_ip)->pino;
  596 + inode->i_private)->pino;
597 597 }
598 598 D3(printk("jffs_readdir(): \"..\" %u\n", ddino));
599 599 if (filldir(dirent, "..", 2, filp->f_pos, ddino, DT_DIR) < 0) {
... ... @@ -604,7 +604,7 @@
604 604 }
605 605 filp->f_pos++;
606 606 }
607   - f = ((struct jffs_file *)inode->u.generic_ip)->children;
  607 + f = ((struct jffs_file *)inode->i_private)->children;
608 608  
609 609 j = 2;
610 610 while(f && (f->deleted || j++ < filp->f_pos )) {
... ... @@ -668,7 +668,7 @@
668 668 }
669 669  
670 670 r = -EACCES;
671   - if (!(d = (struct jffs_file *)dir->u.generic_ip)) {
  671 + if (!(d = (struct jffs_file *)dir->i_private)) {
672 672 D(printk("jffs_lookup(): No such inode! (%lu)\n",
673 673 dir->i_ino));
674 674 goto jffs_lookup_end;
... ... @@ -739,7 +739,7 @@
739 739 unsigned long read_len;
740 740 int result;
741 741 struct inode *inode = (struct inode*)page->mapping->host;
742   - struct jffs_file *f = (struct jffs_file *)inode->u.generic_ip;
  742 + struct jffs_file *f = (struct jffs_file *)inode->i_private;
743 743 struct jffs_control *c = (struct jffs_control *)inode->i_sb->s_fs_info;
744 744 int r;
745 745 loff_t offset;
... ... @@ -828,7 +828,7 @@
828 828 });
829 829  
830 830 lock_kernel();
831   - dir_f = (struct jffs_file *)dir->u.generic_ip;
  831 + dir_f = dir->i_private;
832 832  
833 833 ASSERT(if (!dir_f) {
834 834 printk(KERN_ERR "jffs_mkdir(): No reference to a "
... ... @@ -972,7 +972,7 @@
972 972 kfree(_name);
973 973 });
974 974  
975   - dir_f = (struct jffs_file *) dir->u.generic_ip;
  975 + dir_f = dir->i_private;
976 976 c = dir_f->c;
977 977  
978 978 result = -ENOENT;
... ... @@ -1082,7 +1082,7 @@
1082 1082 if (!old_valid_dev(rdev))
1083 1083 return -EINVAL;
1084 1084 lock_kernel();
1085   - dir_f = (struct jffs_file *)dir->u.generic_ip;
  1085 + dir_f = dir->i_private;
1086 1086 c = dir_f->c;
1087 1087  
1088 1088 D3(printk (KERN_NOTICE "mknod(): down biglock\n"));
... ... @@ -1186,7 +1186,7 @@
1186 1186 kfree(_symname);
1187 1187 });
1188 1188  
1189   - dir_f = (struct jffs_file *)dir->u.generic_ip;
  1189 + dir_f = dir->i_private;
1190 1190 ASSERT(if (!dir_f) {
1191 1191 printk(KERN_ERR "jffs_symlink(): No reference to a "
1192 1192 "jffs_file struct in inode.\n");
... ... @@ -1289,7 +1289,7 @@
1289 1289 kfree(s);
1290 1290 });
1291 1291  
1292   - dir_f = (struct jffs_file *)dir->u.generic_ip;
  1292 + dir_f = dir->i_private;
1293 1293 ASSERT(if (!dir_f) {
1294 1294 printk(KERN_ERR "jffs_create(): No reference to a "
1295 1295 "jffs_file struct in inode.\n");
... ... @@ -1403,9 +1403,9 @@
1403 1403 goto out_isem;
1404 1404 }
1405 1405  
1406   - if (!(f = (struct jffs_file *)inode->u.generic_ip)) {
1407   - D(printk("jffs_file_write(): inode->u.generic_ip = 0x%p\n",
1408   - inode->u.generic_ip));
  1406 + if (!(f = inode->i_private)) {
  1407 + D(printk("jffs_file_write(): inode->i_private = 0x%p\n",
  1408 + inode->i_private));
1409 1409 goto out_isem;
1410 1410 }
1411 1411  
... ... @@ -1693,7 +1693,7 @@
1693 1693 mutex_unlock(&c->fmc->biglock);
1694 1694 return;
1695 1695 }
1696   - inode->u.generic_ip = (void *)f;
  1696 + inode->i_private = f;
1697 1697 inode->i_mode = f->mode;
1698 1698 inode->i_nlink = f->nlink;
1699 1699 inode->i_uid = f->uid;
... ... @@ -1748,7 +1748,7 @@
1748 1748 lock_kernel();
1749 1749 inode->i_size = 0;
1750 1750 inode->i_blocks = 0;
1751   - inode->u.generic_ip = NULL;
  1751 + inode->i_private = NULL;
1752 1752 clear_inode(inode);
1753 1753 if (inode->i_nlink == 0) {
1754 1754 c = (struct jffs_control *) inode->i_sb->s_fs_info;
... ... @@ -547,7 +547,7 @@
547 547  
548 548 attr->get = get;
549 549 attr->set = set;
550   - attr->data = inode->u.generic_ip;
  550 + attr->data = inode->i_private;
551 551 attr->fmt = fmt;
552 552 mutex_init(&attr->mutex);
553 553  
... ... @@ -2052,7 +2052,7 @@
2052 2052 mlog_errno(ret);
2053 2053 goto out;
2054 2054 }
2055   - osb = (struct ocfs2_super *) inode->u.generic_ip;
  2055 + osb = inode->i_private;
2056 2056 ocfs2_get_dlm_debug(osb->osb_dlm_debug);
2057 2057 priv->p_dlm_debug = osb->osb_dlm_debug;
2058 2058 INIT_LIST_HEAD(&priv->p_iter_res.l_debug_list);
... ... @@ -554,9 +554,7 @@
554 554  
555 555 atomic_t i_writecount;
556 556 void *i_security;
557   - union {
558   - void *generic_ip;
559   - } u;
  557 + void *i_private; /* fs or device private pointer */
560 558 #ifdef __NEED_I_SIZE_ORDERED
561 559 seqcount_t i_size_seqcount;
562 560 #endif
... ... @@ -669,7 +669,7 @@
669 669 */
670 670 static int relay_file_open(struct inode *inode, struct file *filp)
671 671 {
672   - struct rchan_buf *buf = inode->u.generic_ip;
  672 + struct rchan_buf *buf = inode->i_private;
673 673 kref_get(&buf->kref);
674 674 filp->private_data = buf;
675 675  
... ... @@ -44,8 +44,8 @@
44 44  
45 45 static int default_open(struct inode *inode, struct file *file)
46 46 {
47   - if (inode->u.generic_ip)
48   - file->private_data = inode->u.generic_ip;
  47 + if (inode->i_private)
  48 + file->private_data = inode->i_private;
49 49  
50 50 return 0;
51 51 }
... ... @@ -194,7 +194,7 @@
194 194 * directory dentry if set. If this paramater is NULL, then the
195 195 * file will be created in the root of the securityfs filesystem.
196 196 * @data: a pointer to something that the caller will want to get to later
197   - * on. The inode.u.generic_ip pointer will point to this value on
  197 + * on. The inode.i_private pointer will point to this value on
198 198 * the open() call.
199 199 * @fops: a pointer to a struct file_operations that should be used for
200 200 * this file.
... ... @@ -240,7 +240,7 @@
240 240 if (fops)
241 241 dentry->d_inode->i_fop = fops;
242 242 if (data)
243   - dentry->d_inode->u.generic_ip = data;
  243 + dentry->d_inode->i_private = data;
244 244 }
245 245 exit:
246 246 return dentry;