Commit 8e18e2941c53416aa219708e7dcad21fb4bd6794
Committed by
Linus Torvalds
1 parent
6a1d9805ec
Exists in
master
and in
7 other branches
[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
- arch/powerpc/platforms/pseries/hvCall_inst.c
- arch/s390/hypfs/inode.c
- arch/s390/kernel/debug.c
- block/blktrace.c
- drivers/i2c/chips/tps65010.c
- drivers/infiniband/hw/ipath/ipath_fs.c
- drivers/infiniband/ulp/ipoib/ipoib_fs.c
- drivers/misc/ibmasm/ibmasmfs.c
- drivers/net/irda/vlsi_ir.h
- drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
- drivers/oprofile/oprofilefs.c
- drivers/pci/hotplug/cpqphp_sysfs.c
- drivers/usb/core/devio.c
- drivers/usb/core/inode.c
- drivers/usb/gadget/inode.c
- drivers/usb/host/isp116x-hcd.c
- drivers/usb/host/uhci-debug.c
- drivers/usb/mon/mon_stat.c
- drivers/usb/mon/mon_text.c
- fs/autofs/inode.c
- fs/autofs/symlink.c
- fs/binfmt_misc.c
- fs/debugfs/file.c
- fs/debugfs/inode.c
- fs/devpts/inode.c
- fs/freevxfs/vxfs.h
- fs/freevxfs/vxfs_inode.c
- fs/fuse/control.c
- fs/inode.c
- fs/jffs/inode-v23.c
- fs/libfs.c
- fs/ocfs2/dlmglue.c
- include/linux/fs.h
- kernel/relay.c
- security/inode.c
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
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]) |
block/blktrace.c
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
drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
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
drivers/usb/core/devio.c
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
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"); |
fs/autofs/inode.c
... | ... | @@ -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; |
fs/autofs/symlink.c
... | ... | @@ -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 | } |
fs/binfmt_misc.c
... | ... | @@ -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); |
fs/debugfs/file.c
fs/debugfs/inode.c
... | ... | @@ -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 | } |
fs/devpts/inode.c
... | ... | @@ -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 |
fs/freevxfs/vxfs.h
... | ... | @@ -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 | } |
fs/fuse/control.c
... | ... | @@ -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 | } |
fs/inode.c
fs/jffs/inode-v23.c
... | ... | @@ -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; |
fs/libfs.c
fs/ocfs2/dlmglue.c
... | ... | @@ -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); |
include/linux/fs.h
kernel/relay.c
security/inode.c
... | ... | @@ -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; |