diff options
| author | Theodore Ts'o <tytso@mit.edu> | 2006-09-27 04:50:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:17 -0400 |
| commit | 8e18e2941c53416aa219708e7dcad21fb4bd6794 (patch) | |
| tree | 44118f8b09556193ac93e0b71aecfa3e1d4bc182 | |
| parent | 6a1d9805ec506d8b9d04450997707da5f643d87c (diff) | |
[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>
36 files changed, 88 insertions, 90 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 7b4572805db9..b837f12a84ae 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
| @@ -120,7 +120,7 @@ spufs_new_file(struct super_block *sb, struct dentry *dentry, | |||
| 120 | ret = 0; | 120 | ret = 0; |
| 121 | inode->i_op = &spufs_file_iops; | 121 | inode->i_op = &spufs_file_iops; |
| 122 | inode->i_fop = fops; | 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 | d_add(dentry, inode); | 124 | d_add(dentry, inode); |
| 125 | out: | 125 | out: |
| 126 | return ret; | 126 | return ret; |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index 641e6511cf06..446e17d162a5 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
| @@ -85,7 +85,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file) | |||
| 85 | 85 | ||
| 86 | rc = seq_open(file, &hcall_inst_seq_ops); | 86 | rc = seq_open(file, &hcall_inst_seq_ops); |
| 87 | seq = file->private_data; | 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 | return rc; | 90 | return rc; |
| 91 | } | 91 | } |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index bdade5f2e325..8735024d235b 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
| @@ -104,13 +104,13 @@ static struct inode *hypfs_make_inode(struct super_block *sb, int mode) | |||
| 104 | 104 | ||
| 105 | static void hypfs_drop_inode(struct inode *inode) | 105 | static void hypfs_drop_inode(struct inode *inode) |
| 106 | { | 106 | { |
| 107 | kfree(inode->u.generic_ip); | 107 | kfree(inode->i_private); |
| 108 | generic_delete_inode(inode); | 108 | generic_delete_inode(inode); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | static int hypfs_open(struct inode *inode, struct file *filp) | 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 | struct hypfs_sb_info *fs_info; | 114 | struct hypfs_sb_info *fs_info; |
| 115 | 115 | ||
| 116 | if (filp->f_mode & FMODE_WRITE) { | 116 | if (filp->f_mode & FMODE_WRITE) { |
| @@ -352,7 +352,7 @@ static struct dentry *hypfs_create_file(struct super_block *sb, | |||
| 352 | parent->d_inode->i_nlink++; | 352 | parent->d_inode->i_nlink++; |
| 353 | } else | 353 | } else |
| 354 | BUG(); | 354 | BUG(); |
| 355 | inode->u.generic_ip = data; | 355 | inode->i_private = data; |
| 356 | d_instantiate(dentry, inode); | 356 | d_instantiate(dentry, inode); |
| 357 | dget(dentry); | 357 | dget(dentry); |
| 358 | return dentry; | 358 | return dentry; |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 7ba20922a535..43f3d0c7e132 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
| @@ -603,7 +603,7 @@ debug_open(struct inode *inode, struct file *file) | |||
| 603 | debug_info_t *debug_info, *debug_info_snapshot; | 603 | debug_info_t *debug_info, *debug_info_snapshot; |
| 604 | 604 | ||
| 605 | down(&debug_lock); | 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 | /* find debug view */ | 607 | /* find debug view */ |
| 608 | for (i = 0; i < DEBUG_MAX_VIEWS; i++) { | 608 | for (i = 0; i < DEBUG_MAX_VIEWS; i++) { |
| 609 | if (!debug_info->views[i]) | 609 | if (!debug_info->views[i]) |
diff --git a/block/blktrace.c b/block/blktrace.c index 265f7a830619..2b4ef2b89b8d 100644 --- a/block/blktrace.c +++ b/block/blktrace.c | |||
| @@ -217,7 +217,7 @@ static int blk_trace_remove(request_queue_t *q) | |||
| 217 | 217 | ||
| 218 | static int blk_dropped_open(struct inode *inode, struct file *filp) | 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 | return 0; | 222 | return 0; |
| 223 | } | 223 | } |
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index 0be6fd6a267d..6a7578217177 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c | |||
| @@ -305,7 +305,7 @@ static int dbg_show(struct seq_file *s, void *_) | |||
| 305 | 305 | ||
| 306 | static int dbg_tps_open(struct inode *inode, struct file *file) | 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 | static struct file_operations debug_fops = { | 311 | static struct file_operations debug_fops = { |
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index a5eb30a06a5c..055cdd089b28 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
| @@ -64,7 +64,7 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry, | |||
| 64 | inode->i_blksize = PAGE_CACHE_SIZE; | 64 | inode->i_blksize = PAGE_CACHE_SIZE; |
| 65 | inode->i_blocks = 0; | 65 | inode->i_blocks = 0; |
| 66 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 66 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
| 67 | inode->u.generic_ip = data; | 67 | inode->i_private = data; |
| 68 | if ((mode & S_IFMT) == S_IFDIR) { | 68 | if ((mode & S_IFMT) == S_IFDIR) { |
| 69 | inode->i_op = &simple_dir_inode_operations; | 69 | inode->i_op = &simple_dir_inode_operations; |
| 70 | inode->i_nlink++; | 70 | inode->i_nlink++; |
| @@ -119,7 +119,7 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf, | |||
| 119 | u16 i; | 119 | u16 i; |
| 120 | struct ipath_devdata *dd; | 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 | for (i = 0; i < NUM_COUNTERS; i++) | 124 | for (i = 0; i < NUM_COUNTERS; i++) |
| 125 | counters[i] = ipath_snap_cntr(dd, i); | 125 | counters[i] = ipath_snap_cntr(dd, i); |
| @@ -139,7 +139,7 @@ static ssize_t atomic_node_info_read(struct file *file, char __user *buf, | |||
| 139 | struct ipath_devdata *dd; | 139 | struct ipath_devdata *dd; |
| 140 | u64 guid; | 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 | guid = be64_to_cpu(dd->ipath_guid); | 144 | guid = be64_to_cpu(dd->ipath_guid); |
| 145 | 145 | ||
| @@ -178,7 +178,7 @@ static ssize_t atomic_port_info_read(struct file *file, char __user *buf, | |||
| 178 | u32 tmp, tmp2; | 178 | u32 tmp, tmp2; |
| 179 | struct ipath_devdata *dd; | 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 | /* so we only initialize non-zero fields. */ | 183 | /* so we only initialize non-zero fields. */ |
| 184 | memset(portinfo, 0, sizeof portinfo); | 184 | memset(portinfo, 0, sizeof portinfo); |
| @@ -325,7 +325,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, | |||
| 325 | goto bail; | 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 | if (ipath_eeprom_read(dd, pos, tmp, count)) { | 329 | if (ipath_eeprom_read(dd, pos, tmp, count)) { |
| 330 | ipath_dev_err(dd, "failed to read from flash\n"); | 330 | ipath_dev_err(dd, "failed to read from flash\n"); |
| 331 | ret = -ENXIO; | 331 | ret = -ENXIO; |
| @@ -381,7 +381,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf, | |||
| 381 | goto bail_tmp; | 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 | if (ipath_eeprom_write(dd, pos, tmp, count)) { | 385 | if (ipath_eeprom_write(dd, pos, tmp, count)) { |
| 386 | ret = -ENXIO; | 386 | ret = -ENXIO; |
| 387 | ipath_dev_err(dd, "failed to write to flash\n"); | 387 | ipath_dev_err(dd, "failed to write to flash\n"); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_fs.c b/drivers/infiniband/ulp/ipoib/ipoib_fs.c index 5dde380e8dbe..f1cb83688b31 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_fs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_fs.c | |||
| @@ -141,7 +141,7 @@ static int ipoib_mcg_open(struct inode *inode, struct file *file) | |||
| 141 | return ret; | 141 | return ret; |
| 142 | 142 | ||
| 143 | seq = file->private_data; | 143 | seq = file->private_data; |
| 144 | seq->private = inode->u.generic_ip; | 144 | seq->private = inode->i_private; |
| 145 | 145 | ||
| 146 | return 0; | 146 | return 0; |
| 147 | } | 147 | } |
| @@ -247,7 +247,7 @@ static int ipoib_path_open(struct inode *inode, struct file *file) | |||
| 247 | return ret; | 247 | return ret; |
| 248 | 248 | ||
| 249 | seq = file->private_data; | 249 | seq = file->private_data; |
| 250 | seq->private = inode->u.generic_ip; | 250 | seq->private = inode->i_private; |
| 251 | 251 | ||
| 252 | return 0; | 252 | return 0; |
| 253 | } | 253 | } |
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 4a35caff5d02..0e909b617226 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c | |||
| @@ -175,7 +175,7 @@ static struct dentry *ibmasmfs_create_file (struct super_block *sb, | |||
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | inode->i_fop = fops; | 177 | inode->i_fop = fops; |
| 178 | inode->u.generic_ip = data; | 178 | inode->i_private = data; |
| 179 | 179 | ||
| 180 | d_add(dentry, inode); | 180 | d_add(dentry, inode); |
| 181 | return dentry; | 181 | return dentry; |
| @@ -244,7 +244,7 @@ static int command_file_open(struct inode *inode, struct file *file) | |||
| 244 | { | 244 | { |
| 245 | struct ibmasmfs_command_data *command_data; | 245 | struct ibmasmfs_command_data *command_data; |
| 246 | 246 | ||
| 247 | if (!inode->u.generic_ip) | 247 | if (!inode->i_private) |
| 248 | return -ENODEV; | 248 | return -ENODEV; |
| 249 | 249 | ||
| 250 | command_data = kmalloc(sizeof(struct ibmasmfs_command_data), GFP_KERNEL); | 250 | command_data = kmalloc(sizeof(struct ibmasmfs_command_data), GFP_KERNEL); |
| @@ -252,7 +252,7 @@ static int command_file_open(struct inode *inode, struct file *file) | |||
| 252 | return -ENOMEM; | 252 | return -ENOMEM; |
| 253 | 253 | ||
| 254 | command_data->command = NULL; | 254 | command_data->command = NULL; |
| 255 | command_data->sp = inode->u.generic_ip; | 255 | command_data->sp = inode->i_private; |
| 256 | file->private_data = command_data; | 256 | file->private_data = command_data; |
| 257 | return 0; | 257 | return 0; |
| 258 | } | 258 | } |
| @@ -351,10 +351,10 @@ static int event_file_open(struct inode *inode, struct file *file) | |||
| 351 | struct ibmasmfs_event_data *event_data; | 351 | struct ibmasmfs_event_data *event_data; |
| 352 | struct service_processor *sp; | 352 | struct service_processor *sp; |
| 353 | 353 | ||
| 354 | if (!inode->u.generic_ip) | 354 | if (!inode->i_private) |
| 355 | return -ENODEV; | 355 | return -ENODEV; |
| 356 | 356 | ||
| 357 | sp = inode->u.generic_ip; | 357 | sp = inode->i_private; |
| 358 | 358 | ||
| 359 | event_data = kmalloc(sizeof(struct ibmasmfs_event_data), GFP_KERNEL); | 359 | event_data = kmalloc(sizeof(struct ibmasmfs_event_data), GFP_KERNEL); |
| 360 | if (!event_data) | 360 | if (!event_data) |
| @@ -439,14 +439,14 @@ static int r_heartbeat_file_open(struct inode *inode, struct file *file) | |||
| 439 | { | 439 | { |
| 440 | struct ibmasmfs_heartbeat_data *rhbeat; | 440 | struct ibmasmfs_heartbeat_data *rhbeat; |
| 441 | 441 | ||
| 442 | if (!inode->u.generic_ip) | 442 | if (!inode->i_private) |
| 443 | return -ENODEV; | 443 | return -ENODEV; |
| 444 | 444 | ||
| 445 | rhbeat = kmalloc(sizeof(struct ibmasmfs_heartbeat_data), GFP_KERNEL); | 445 | rhbeat = kmalloc(sizeof(struct ibmasmfs_heartbeat_data), GFP_KERNEL); |
| 446 | if (!rhbeat) | 446 | if (!rhbeat) |
| 447 | return -ENOMEM; | 447 | return -ENOMEM; |
| 448 | 448 | ||
| 449 | rhbeat->sp = (struct service_processor *)inode->u.generic_ip; | 449 | rhbeat->sp = inode->i_private; |
| 450 | rhbeat->active = 0; | 450 | rhbeat->active = 0; |
| 451 | ibmasm_init_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat); | 451 | ibmasm_init_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat); |
| 452 | file->private_data = rhbeat; | 452 | file->private_data = rhbeat; |
| @@ -508,7 +508,7 @@ static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf, | |||
| 508 | 508 | ||
| 509 | static int remote_settings_file_open(struct inode *inode, struct file *file) | 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 | return 0; | 512 | return 0; |
| 513 | } | 513 | } |
| 514 | 514 | ||
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h index a82a4ba8de4f..c37f0bc4c7f9 100644 --- a/drivers/net/irda/vlsi_ir.h +++ b/drivers/net/irda/vlsi_ir.h | |||
| @@ -58,7 +58,7 @@ typedef void irqreturn_t; | |||
| 58 | 58 | ||
| 59 | /* PDE() introduced in 2.5.4 */ | 59 | /* PDE() introduced in 2.5.4 */ |
| 60 | #ifdef CONFIG_PROC_FS | 60 | #ifdef CONFIG_PROC_FS |
| 61 | #define PDE(inode) ((inode)->u.generic_ip) | 61 | #define PDE(inode) ((inode)->i_private) |
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | /* irda crc16 calculation exported in 2.5.42 */ | 64 | /* irda crc16 calculation exported in 2.5.42 */ |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c index 923275ea0789..b9df06a06ea9 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c | |||
| @@ -54,7 +54,7 @@ static ssize_t write_file_dummy(struct file *file, const char __user *buf, | |||
| 54 | 54 | ||
| 55 | static int open_file_generic(struct inode *inode, struct file *file) | 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 | return 0; | 58 | return 0; |
| 59 | } | 59 | } |
| 60 | 60 | ||
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 71c2da277d6e..deb37354785b 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
| @@ -110,8 +110,8 @@ static ssize_t ulong_write_file(struct file * file, char const __user * buf, siz | |||
| 110 | 110 | ||
| 111 | static int default_open(struct inode * inode, struct file * filp) | 111 | static int default_open(struct inode * inode, struct file * filp) |
| 112 | { | 112 | { |
| 113 | if (inode->u.generic_ip) | 113 | if (inode->i_private) |
| 114 | filp->private_data = inode->u.generic_ip; | 114 | filp->private_data = inode->i_private; |
| 115 | return 0; | 115 | return 0; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| @@ -158,7 +158,7 @@ int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root, | |||
| 158 | if (!d) | 158 | if (!d) |
| 159 | return -EFAULT; | 159 | return -EFAULT; |
| 160 | 160 | ||
| 161 | d->d_inode->u.generic_ip = val; | 161 | d->d_inode->i_private = val; |
| 162 | return 0; | 162 | return 0; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| @@ -171,7 +171,7 @@ int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root, | |||
| 171 | if (!d) | 171 | if (!d) |
| 172 | return -EFAULT; | 172 | return -EFAULT; |
| 173 | 173 | ||
| 174 | d->d_inode->u.generic_ip = val; | 174 | d->d_inode->i_private = val; |
| 175 | return 0; | 175 | return 0; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| @@ -197,7 +197,7 @@ int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root, | |||
| 197 | if (!d) | 197 | if (!d) |
| 198 | return -EFAULT; | 198 | return -EFAULT; |
| 199 | 199 | ||
| 200 | d->d_inode->u.generic_ip = val; | 200 | d->d_inode->i_private = val; |
| 201 | return 0; | 201 | return 0; |
| 202 | } | 202 | } |
| 203 | 203 | ||
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c index 8b3da007e859..5bab666cd67e 100644 --- a/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/drivers/pci/hotplug/cpqphp_sysfs.c | |||
| @@ -140,7 +140,7 @@ struct ctrl_dbg { | |||
| 140 | 140 | ||
| 141 | static int open(struct inode *inode, struct file *file) | 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 | struct ctrl_dbg *dbg; | 144 | struct ctrl_dbg *dbg; |
| 145 | int retval = -ENOMEM; | 145 | int retval = -ENOMEM; |
| 146 | 146 | ||
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 218621b9958e..32e03000420c 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
| @@ -555,7 +555,7 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
| 555 | if (imajor(inode) == USB_DEVICE_MAJOR) | 555 | if (imajor(inode) == USB_DEVICE_MAJOR) |
| 556 | dev = usbdev_lookup_minor(iminor(inode)); | 556 | dev = usbdev_lookup_minor(iminor(inode)); |
| 557 | if (!dev) | 557 | if (!dev) |
| 558 | dev = inode->u.generic_ip; | 558 | dev = inode->i_private; |
| 559 | if (!dev) { | 559 | if (!dev) { |
| 560 | kfree(ps); | 560 | kfree(ps); |
| 561 | goto out; | 561 | goto out; |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 3182c2224ba2..482f253085e5 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
| @@ -402,8 +402,8 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig) | |||
| 402 | 402 | ||
| 403 | static int default_open (struct inode *inode, struct file *file) | 403 | static int default_open (struct inode *inode, struct file *file) |
| 404 | { | 404 | { |
| 405 | if (inode->u.generic_ip) | 405 | if (inode->i_private) |
| 406 | file->private_data = inode->u.generic_ip; | 406 | file->private_data = inode->i_private; |
| 407 | 407 | ||
| 408 | return 0; | 408 | return 0; |
| 409 | } | 409 | } |
| @@ -509,7 +509,7 @@ static struct dentry *fs_create_file (const char *name, mode_t mode, | |||
| 509 | } else { | 509 | } else { |
| 510 | if (dentry->d_inode) { | 510 | if (dentry->d_inode) { |
| 511 | if (data) | 511 | if (data) |
| 512 | dentry->d_inode->u.generic_ip = data; | 512 | dentry->d_inode->i_private = data; |
| 513 | if (fops) | 513 | if (fops) |
| 514 | dentry->d_inode->i_fop = fops; | 514 | dentry->d_inode->i_fop = fops; |
| 515 | dentry->d_inode->i_uid = uid; | 515 | dentry->d_inode->i_uid = uid; |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index 3bdc5e3ba234..ffaa8c1afad8 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
| @@ -844,7 +844,7 @@ fail1: | |||
| 844 | static int | 844 | static int |
| 845 | ep_open (struct inode *inode, struct file *fd) | 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 | int value = -EBUSY; | 848 | int value = -EBUSY; |
| 849 | 849 | ||
| 850 | if (down_interruptible (&data->lock) != 0) | 850 | if (down_interruptible (&data->lock) != 0) |
| @@ -1909,7 +1909,7 @@ fail: | |||
| 1909 | static int | 1909 | static int |
| 1910 | dev_open (struct inode *inode, struct file *fd) | 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 | int value = -EBUSY; | 1913 | int value = -EBUSY; |
| 1914 | 1914 | ||
| 1915 | if (dev->state == STATE_DEV_DISABLED) { | 1915 | if (dev->state == STATE_DEV_DISABLED) { |
| @@ -1970,7 +1970,7 @@ gadgetfs_make_inode (struct super_block *sb, | |||
| 1970 | inode->i_blocks = 0; | 1970 | inode->i_blocks = 0; |
| 1971 | inode->i_atime = inode->i_mtime = inode->i_ctime | 1971 | inode->i_atime = inode->i_mtime = inode->i_ctime |
| 1972 | = CURRENT_TIME; | 1972 | = CURRENT_TIME; |
| 1973 | inode->u.generic_ip = data; | 1973 | inode->i_private = data; |
| 1974 | inode->i_fop = fops; | 1974 | inode->i_fop = fops; |
| 1975 | } | 1975 | } |
| 1976 | return inode; | 1976 | return inode; |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 5147ed4a6662..8c6b38a0b5bb 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
| @@ -1204,7 +1204,7 @@ static int isp116x_show_dbg(struct seq_file *s, void *unused) | |||
| 1204 | 1204 | ||
| 1205 | static int isp116x_open_seq(struct inode *inode, struct file *file) | 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 | static struct file_operations isp116x_debug_fops = { | 1210 | static struct file_operations isp116x_debug_fops = { |
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index dc286a48cafd..d1372cb27f33 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
| @@ -428,7 +428,7 @@ struct uhci_debug { | |||
| 428 | 428 | ||
| 429 | static int uhci_debug_open(struct inode *inode, struct file *file) | 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 | struct uhci_debug *up; | 432 | struct uhci_debug *up; |
| 433 | int ret = -ENOMEM; | 433 | int ret = -ENOMEM; |
| 434 | unsigned long flags; | 434 | unsigned long flags; |
diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index 1fe01d994a79..86ad2b381c4b 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c | |||
| @@ -28,7 +28,7 @@ static int mon_stat_open(struct inode *inode, struct file *file) | |||
| 28 | if ((sp = kmalloc(sizeof(struct snap), GFP_KERNEL)) == NULL) | 28 | if ((sp = kmalloc(sizeof(struct snap), GFP_KERNEL)) == NULL) |
| 29 | return -ENOMEM; | 29 | return -ENOMEM; |
| 30 | 30 | ||
| 31 | mbus = inode->u.generic_ip; | 31 | mbus = inode->i_private; |
| 32 | 32 | ||
| 33 | sp->slen = snprintf(sp->str, STAT_BUF_SIZE, | 33 | sp->slen = snprintf(sp->str, STAT_BUF_SIZE, |
| 34 | "nreaders %d events %u text_lost %u\n", | 34 | "nreaders %d events %u text_lost %u\n", |
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index f961a770cee2..2fd39b4fa166 100644 --- a/drivers/usb/mon/mon_text.c +++ b/drivers/usb/mon/mon_text.c | |||
| @@ -238,7 +238,7 @@ static int mon_text_open(struct inode *inode, struct file *file) | |||
| 238 | int rc; | 238 | int rc; |
| 239 | 239 | ||
| 240 | mutex_lock(&mon_lock); | 240 | mutex_lock(&mon_lock); |
| 241 | mbus = inode->u.generic_ip; | 241 | mbus = inode->i_private; |
| 242 | ubus = mbus->u_bus; | 242 | ubus = mbus->u_bus; |
| 243 | 243 | ||
| 244 | rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL); | 244 | rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL); |
| @@ -401,7 +401,7 @@ static int mon_text_release(struct inode *inode, struct file *file) | |||
| 401 | struct mon_event_text *ep; | 401 | struct mon_event_text *ep; |
| 402 | 402 | ||
| 403 | mutex_lock(&mon_lock); | 403 | mutex_lock(&mon_lock); |
| 404 | mbus = inode->u.generic_ip; | 404 | mbus = inode->i_private; |
| 405 | 405 | ||
| 406 | if (mbus->nreaders <= 0) { | 406 | if (mbus->nreaders <= 0) { |
| 407 | printk(KERN_ERR TAG ": consistency error on close\n"); | 407 | printk(KERN_ERR TAG ": consistency error on close\n"); |
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index c81d6b8c2828..d39d2acd9b38 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c | |||
| @@ -241,7 +241,7 @@ static void autofs_read_inode(struct inode *inode) | |||
| 241 | 241 | ||
| 242 | inode->i_op = &autofs_symlink_inode_operations; | 242 | inode->i_op = &autofs_symlink_inode_operations; |
| 243 | sl = &sbi->symlink[n]; | 243 | sl = &sbi->symlink[n]; |
| 244 | inode->u.generic_ip = sl; | 244 | inode->i_private = sl; |
| 245 | inode->i_mode = S_IFLNK | S_IRWXUGO; | 245 | inode->i_mode = S_IFLNK | S_IRWXUGO; |
| 246 | inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = sl->mtime; | 246 | inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = sl->mtime; |
| 247 | inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; | 247 | inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; |
diff --git a/fs/autofs/symlink.c b/fs/autofs/symlink.c index 52e8772b066e..c74f2eb65775 100644 --- a/fs/autofs/symlink.c +++ b/fs/autofs/symlink.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | /* Nothing to release.. */ | 15 | /* Nothing to release.. */ |
| 16 | static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | 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 | nd_set_link(nd, s); | 19 | nd_set_link(nd, s); |
| 20 | return NULL; | 20 | return NULL; |
| 21 | } | 21 | } |
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 34ebbc191e46..6759b9839ce8 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
| @@ -517,7 +517,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) | |||
| 517 | 517 | ||
| 518 | static void bm_clear_inode(struct inode *inode) | 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 | static void kill_node(Node *e) | 523 | static void kill_node(Node *e) |
| @@ -545,7 +545,7 @@ static void kill_node(Node *e) | |||
| 545 | static ssize_t | 545 | static ssize_t |
| 546 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) | 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 | loff_t pos = *ppos; | 549 | loff_t pos = *ppos; |
| 550 | ssize_t res; | 550 | ssize_t res; |
| 551 | char *page; | 551 | char *page; |
| @@ -579,7 +579,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer, | |||
| 579 | size_t count, loff_t *ppos) | 579 | size_t count, loff_t *ppos) |
| 580 | { | 580 | { |
| 581 | struct dentry *root; | 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 | int res = parse_command(buffer, count); | 583 | int res = parse_command(buffer, count); |
| 584 | 584 | ||
| 585 | switch (res) { | 585 | switch (res) { |
| @@ -646,7 +646,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer, | |||
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | e->dentry = dget(dentry); | 648 | e->dentry = dget(dentry); |
| 649 | inode->u.generic_ip = e; | 649 | inode->i_private = e; |
| 650 | inode->i_fop = &bm_entry_operations; | 650 | inode->i_fop = &bm_entry_operations; |
| 651 | 651 | ||
| 652 | d_instantiate(dentry, inode); | 652 | d_instantiate(dentry, inode); |
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index e4b430552c88..bf3901ab1744 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
| @@ -32,8 +32,8 @@ static ssize_t default_write_file(struct file *file, const char __user *buf, | |||
| 32 | 32 | ||
| 33 | static int default_open(struct inode *inode, struct file *file) | 33 | static int default_open(struct inode *inode, struct file *file) |
| 34 | { | 34 | { |
| 35 | if (inode->u.generic_ip) | 35 | if (inode->i_private) |
| 36 | file->private_data = inode->u.generic_ip; | 36 | file->private_data = inode->i_private; |
| 37 | 37 | ||
| 38 | return 0; | 38 | return 0; |
| 39 | } | 39 | } |
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 3ca268d2e5a2..717f4821ed02 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
| @@ -168,7 +168,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode, | |||
| 168 | * directory dentry if set. If this paramater is NULL, then the | 168 | * directory dentry if set. If this paramater is NULL, then the |
| 169 | * file will be created in the root of the debugfs filesystem. | 169 | * file will be created in the root of the debugfs filesystem. |
| 170 | * @data: a pointer to something that the caller will want to get to later | 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 | * the open() call. | 172 | * the open() call. |
| 173 | * @fops: a pointer to a struct file_operations that should be used for | 173 | * @fops: a pointer to a struct file_operations that should be used for |
| 174 | * this file. | 174 | * this file. |
| @@ -209,7 +209,7 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode, | |||
| 209 | 209 | ||
| 210 | if (dentry->d_inode) { | 210 | if (dentry->d_inode) { |
| 211 | if (data) | 211 | if (data) |
| 212 | dentry->d_inode->u.generic_ip = data; | 212 | dentry->d_inode->i_private = data; |
| 213 | if (fops) | 213 | if (fops) |
| 214 | dentry->d_inode->i_fop = fops; | 214 | dentry->d_inode->i_fop = fops; |
| 215 | } | 215 | } |
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index f7aef5bb584a..5bf06a10dddf 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c | |||
| @@ -177,7 +177,7 @@ int devpts_pty_new(struct tty_struct *tty) | |||
| 177 | inode->i_gid = config.setgid ? config.gid : current->fsgid; | 177 | inode->i_gid = config.setgid ? config.gid : current->fsgid; |
| 178 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 178 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
| 179 | init_special_inode(inode, S_IFCHR|config.mode, device); | 179 | init_special_inode(inode, S_IFCHR|config.mode, device); |
| 180 | inode->u.generic_ip = tty; | 180 | inode->i_private = tty; |
| 181 | 181 | ||
| 182 | dentry = get_node(number); | 182 | dentry = get_node(number); |
| 183 | if (!IS_ERR(dentry) && !dentry->d_inode) | 183 | if (!IS_ERR(dentry) && !dentry->d_inode) |
| @@ -196,7 +196,7 @@ struct tty_struct *devpts_get_tty(int number) | |||
| 196 | tty = NULL; | 196 | tty = NULL; |
| 197 | if (!IS_ERR(dentry)) { | 197 | if (!IS_ERR(dentry)) { |
| 198 | if (dentry->d_inode) | 198 | if (dentry->d_inode) |
| 199 | tty = dentry->d_inode->u.generic_ip; | 199 | tty = dentry->d_inode->i_private; |
| 200 | dput(dentry); | 200 | dput(dentry); |
| 201 | } | 201 | } |
| 202 | 202 | ||
diff --git a/fs/freevxfs/vxfs.h b/fs/freevxfs/vxfs.h index d35979a58743..c8a92652612a 100644 --- a/fs/freevxfs/vxfs.h +++ b/fs/freevxfs/vxfs.h | |||
| @@ -252,7 +252,7 @@ enum { | |||
| 252 | * Get filesystem private data from VFS inode. | 252 | * Get filesystem private data from VFS inode. |
| 253 | */ | 253 | */ |
| 254 | #define VXFS_INO(ip) \ | 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 | * Get filesystem private data from VFS superblock. | 258 | * Get filesystem private data from VFS superblock. |
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c index ca6a39714771..32a82ed108e4 100644 --- a/fs/freevxfs/vxfs_inode.c +++ b/fs/freevxfs/vxfs_inode.c | |||
| @@ -243,7 +243,7 @@ vxfs_iinit(struct inode *ip, struct vxfs_inode_info *vip) | |||
| 243 | ip->i_blocks = vip->vii_blocks; | 243 | ip->i_blocks = vip->vii_blocks; |
| 244 | ip->i_generation = vip->vii_gen; | 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,5 +338,5 @@ vxfs_read_inode(struct inode *ip) | |||
| 338 | void | 338 | void |
| 339 | vxfs_clear_inode(struct inode *ip) | 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 | } |
diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 46fe60b2da23..79ec1f23d4d2 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c | |||
| @@ -23,7 +23,7 @@ static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file) | |||
| 23 | { | 23 | { |
| 24 | struct fuse_conn *fc; | 24 | struct fuse_conn *fc; |
| 25 | mutex_lock(&fuse_mutex); | 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 | if (fc) | 27 | if (fc) |
| 28 | fc = fuse_conn_get(fc); | 28 | fc = fuse_conn_get(fc); |
| 29 | mutex_unlock(&fuse_mutex); | 29 | mutex_unlock(&fuse_mutex); |
| @@ -98,7 +98,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, | |||
| 98 | inode->i_op = iop; | 98 | inode->i_op = iop; |
| 99 | inode->i_fop = fop; | 99 | inode->i_fop = fop; |
| 100 | inode->i_nlink = nlink; | 100 | inode->i_nlink = nlink; |
| 101 | inode->u.generic_ip = fc; | 101 | inode->i_private = fc; |
| 102 | d_add(dentry, inode); | 102 | d_add(dentry, inode); |
| 103 | return dentry; | 103 | return dentry; |
| 104 | } | 104 | } |
| @@ -150,7 +150,7 @@ void fuse_ctl_remove_conn(struct fuse_conn *fc) | |||
| 150 | 150 | ||
| 151 | for (i = fc->ctl_ndents - 1; i >= 0; i--) { | 151 | for (i = fc->ctl_ndents - 1; i >= 0; i--) { |
| 152 | struct dentry *dentry = fc->ctl_dentry[i]; | 152 | struct dentry *dentry = fc->ctl_dentry[i]; |
| 153 | dentry->d_inode->u.generic_ip = NULL; | 153 | dentry->d_inode->i_private = NULL; |
| 154 | d_drop(dentry); | 154 | d_drop(dentry); |
| 155 | dput(dentry); | 155 | dput(dentry); |
| 156 | } | 156 | } |
diff --git a/fs/inode.c b/fs/inode.c index 0bf9f0444a96..77e254792025 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
| @@ -163,7 +163,7 @@ static struct inode *alloc_inode(struct super_block *sb) | |||
| 163 | bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; | 163 | bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; |
| 164 | mapping->backing_dev_info = bdi; | 164 | mapping->backing_dev_info = bdi; |
| 165 | } | 165 | } |
| 166 | memset(&inode->u, 0, sizeof(inode->u)); | 166 | inode->i_private = 0; |
| 167 | inode->i_mapping = mapping; | 167 | inode->i_mapping = mapping; |
| 168 | } | 168 | } |
| 169 | return inode; | 169 | return inode; |
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index b59553d28d13..7358ef87f16b 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c | |||
| @@ -369,7 +369,7 @@ jffs_new_inode(const struct inode * dir, struct jffs_raw_inode *raw_inode, | |||
| 369 | 369 | ||
| 370 | f = jffs_find_file(c, raw_inode->ino); | 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 | insert_inode_hash(inode); | 373 | insert_inode_hash(inode); |
| 374 | 374 | ||
| 375 | return inode; | 375 | return inode; |
| @@ -442,7 +442,7 @@ jffs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 442 | }); | 442 | }); |
| 443 | 443 | ||
| 444 | result = -ENOTDIR; | 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 | D(printk("jffs_rename(): Old dir invalid.\n")); | 446 | D(printk("jffs_rename(): Old dir invalid.\n")); |
| 447 | goto jffs_rename_end; | 447 | goto jffs_rename_end; |
| 448 | } | 448 | } |
| @@ -456,7 +456,7 @@ jffs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 456 | 456 | ||
| 457 | /* Find the new directory. */ | 457 | /* Find the new directory. */ |
| 458 | result = -ENOTDIR; | 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 | D(printk("jffs_rename(): New dir invalid.\n")); | 460 | D(printk("jffs_rename(): New dir invalid.\n")); |
| 461 | goto jffs_rename_end; | 461 | goto jffs_rename_end; |
| 462 | } | 462 | } |
| @@ -593,7 +593,7 @@ jffs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 593 | } | 593 | } |
| 594 | else { | 594 | else { |
| 595 | ddino = ((struct jffs_file *) | 595 | ddino = ((struct jffs_file *) |
| 596 | inode->u.generic_ip)->pino; | 596 | inode->i_private)->pino; |
| 597 | } | 597 | } |
| 598 | D3(printk("jffs_readdir(): \"..\" %u\n", ddino)); | 598 | D3(printk("jffs_readdir(): \"..\" %u\n", ddino)); |
| 599 | if (filldir(dirent, "..", 2, filp->f_pos, ddino, DT_DIR) < 0) { | 599 | if (filldir(dirent, "..", 2, filp->f_pos, ddino, DT_DIR) < 0) { |
| @@ -604,7 +604,7 @@ jffs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 604 | } | 604 | } |
| 605 | filp->f_pos++; | 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 | j = 2; | 609 | j = 2; |
| 610 | while(f && (f->deleted || j++ < filp->f_pos )) { | 610 | while(f && (f->deleted || j++ < filp->f_pos )) { |
| @@ -668,7 +668,7 @@ jffs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
| 668 | } | 668 | } |
| 669 | 669 | ||
| 670 | r = -EACCES; | 670 | r = -EACCES; |
| 671 | if (!(d = (struct jffs_file *)dir->u.generic_ip)) { | 671 | if (!(d = (struct jffs_file *)dir->i_private)) { |
| 672 | D(printk("jffs_lookup(): No such inode! (%lu)\n", | 672 | D(printk("jffs_lookup(): No such inode! (%lu)\n", |
| 673 | dir->i_ino)); | 673 | dir->i_ino)); |
| 674 | goto jffs_lookup_end; | 674 | goto jffs_lookup_end; |
| @@ -739,7 +739,7 @@ jffs_do_readpage_nolock(struct file *file, struct page *page) | |||
| 739 | unsigned long read_len; | 739 | unsigned long read_len; |
| 740 | int result; | 740 | int result; |
| 741 | struct inode *inode = (struct inode*)page->mapping->host; | 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 | struct jffs_control *c = (struct jffs_control *)inode->i_sb->s_fs_info; | 743 | struct jffs_control *c = (struct jffs_control *)inode->i_sb->s_fs_info; |
| 744 | int r; | 744 | int r; |
| 745 | loff_t offset; | 745 | loff_t offset; |
| @@ -828,7 +828,7 @@ jffs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
| 828 | }); | 828 | }); |
| 829 | 829 | ||
| 830 | lock_kernel(); | 830 | lock_kernel(); |
| 831 | dir_f = (struct jffs_file *)dir->u.generic_ip; | 831 | dir_f = dir->i_private; |
| 832 | 832 | ||
| 833 | ASSERT(if (!dir_f) { | 833 | ASSERT(if (!dir_f) { |
| 834 | printk(KERN_ERR "jffs_mkdir(): No reference to a " | 834 | printk(KERN_ERR "jffs_mkdir(): No reference to a " |
| @@ -972,7 +972,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type) | |||
| 972 | kfree(_name); | 972 | kfree(_name); |
| 973 | }); | 973 | }); |
| 974 | 974 | ||
| 975 | dir_f = (struct jffs_file *) dir->u.generic_ip; | 975 | dir_f = dir->i_private; |
| 976 | c = dir_f->c; | 976 | c = dir_f->c; |
| 977 | 977 | ||
| 978 | result = -ENOENT; | 978 | result = -ENOENT; |
| @@ -1082,7 +1082,7 @@ jffs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) | |||
| 1082 | if (!old_valid_dev(rdev)) | 1082 | if (!old_valid_dev(rdev)) |
| 1083 | return -EINVAL; | 1083 | return -EINVAL; |
| 1084 | lock_kernel(); | 1084 | lock_kernel(); |
| 1085 | dir_f = (struct jffs_file *)dir->u.generic_ip; | 1085 | dir_f = dir->i_private; |
| 1086 | c = dir_f->c; | 1086 | c = dir_f->c; |
| 1087 | 1087 | ||
| 1088 | D3(printk (KERN_NOTICE "mknod(): down biglock\n")); | 1088 | D3(printk (KERN_NOTICE "mknod(): down biglock\n")); |
| @@ -1186,7 +1186,7 @@ jffs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | |||
| 1186 | kfree(_symname); | 1186 | kfree(_symname); |
| 1187 | }); | 1187 | }); |
| 1188 | 1188 | ||
| 1189 | dir_f = (struct jffs_file *)dir->u.generic_ip; | 1189 | dir_f = dir->i_private; |
| 1190 | ASSERT(if (!dir_f) { | 1190 | ASSERT(if (!dir_f) { |
| 1191 | printk(KERN_ERR "jffs_symlink(): No reference to a " | 1191 | printk(KERN_ERR "jffs_symlink(): No reference to a " |
| 1192 | "jffs_file struct in inode.\n"); | 1192 | "jffs_file struct in inode.\n"); |
| @@ -1289,7 +1289,7 @@ jffs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
| 1289 | kfree(s); | 1289 | kfree(s); |
| 1290 | }); | 1290 | }); |
| 1291 | 1291 | ||
| 1292 | dir_f = (struct jffs_file *)dir->u.generic_ip; | 1292 | dir_f = dir->i_private; |
| 1293 | ASSERT(if (!dir_f) { | 1293 | ASSERT(if (!dir_f) { |
| 1294 | printk(KERN_ERR "jffs_create(): No reference to a " | 1294 | printk(KERN_ERR "jffs_create(): No reference to a " |
| 1295 | "jffs_file struct in inode.\n"); | 1295 | "jffs_file struct in inode.\n"); |
| @@ -1403,9 +1403,9 @@ jffs_file_write(struct file *filp, const char *buf, size_t count, | |||
| 1403 | goto out_isem; | 1403 | goto out_isem; |
| 1404 | } | 1404 | } |
| 1405 | 1405 | ||
| 1406 | if (!(f = (struct jffs_file *)inode->u.generic_ip)) { | 1406 | if (!(f = inode->i_private)) { |
| 1407 | D(printk("jffs_file_write(): inode->u.generic_ip = 0x%p\n", | 1407 | D(printk("jffs_file_write(): inode->i_private = 0x%p\n", |
| 1408 | inode->u.generic_ip)); | 1408 | inode->i_private)); |
| 1409 | goto out_isem; | 1409 | goto out_isem; |
| 1410 | } | 1410 | } |
| 1411 | 1411 | ||
| @@ -1693,7 +1693,7 @@ jffs_read_inode(struct inode *inode) | |||
| 1693 | mutex_unlock(&c->fmc->biglock); | 1693 | mutex_unlock(&c->fmc->biglock); |
| 1694 | return; | 1694 | return; |
| 1695 | } | 1695 | } |
| 1696 | inode->u.generic_ip = (void *)f; | 1696 | inode->i_private = f; |
| 1697 | inode->i_mode = f->mode; | 1697 | inode->i_mode = f->mode; |
| 1698 | inode->i_nlink = f->nlink; | 1698 | inode->i_nlink = f->nlink; |
| 1699 | inode->i_uid = f->uid; | 1699 | inode->i_uid = f->uid; |
| @@ -1748,7 +1748,7 @@ jffs_delete_inode(struct inode *inode) | |||
| 1748 | lock_kernel(); | 1748 | lock_kernel(); |
| 1749 | inode->i_size = 0; | 1749 | inode->i_size = 0; |
| 1750 | inode->i_blocks = 0; | 1750 | inode->i_blocks = 0; |
| 1751 | inode->u.generic_ip = NULL; | 1751 | inode->i_private = NULL; |
| 1752 | clear_inode(inode); | 1752 | clear_inode(inode); |
| 1753 | if (inode->i_nlink == 0) { | 1753 | if (inode->i_nlink == 0) { |
| 1754 | c = (struct jffs_control *) inode->i_sb->s_fs_info; | 1754 | c = (struct jffs_control *) inode->i_sb->s_fs_info; |
diff --git a/fs/libfs.c b/fs/libfs.c index ac02ea602c3d..2751793beeaa 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
| @@ -547,7 +547,7 @@ int simple_attr_open(struct inode *inode, struct file *file, | |||
| 547 | 547 | ||
| 548 | attr->get = get; | 548 | attr->get = get; |
| 549 | attr->set = set; | 549 | attr->set = set; |
| 550 | attr->data = inode->u.generic_ip; | 550 | attr->data = inode->i_private; |
| 551 | attr->fmt = fmt; | 551 | attr->fmt = fmt; |
| 552 | mutex_init(&attr->mutex); | 552 | mutex_init(&attr->mutex); |
| 553 | 553 | ||
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index de887063dcfc..8801e41afe80 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
| @@ -2052,7 +2052,7 @@ static int ocfs2_dlm_debug_open(struct inode *inode, struct file *file) | |||
| 2052 | mlog_errno(ret); | 2052 | mlog_errno(ret); |
| 2053 | goto out; | 2053 | goto out; |
| 2054 | } | 2054 | } |
| 2055 | osb = (struct ocfs2_super *) inode->u.generic_ip; | 2055 | osb = inode->i_private; |
| 2056 | ocfs2_get_dlm_debug(osb->osb_dlm_debug); | 2056 | ocfs2_get_dlm_debug(osb->osb_dlm_debug); |
| 2057 | priv->p_dlm_debug = osb->osb_dlm_debug; | 2057 | priv->p_dlm_debug = osb->osb_dlm_debug; |
| 2058 | INIT_LIST_HEAD(&priv->p_iter_res.l_debug_list); | 2058 | INIT_LIST_HEAD(&priv->p_iter_res.l_debug_list); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1d3e601ece73..4f77ec9c3353 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -554,9 +554,7 @@ struct inode { | |||
| 554 | 554 | ||
| 555 | atomic_t i_writecount; | 555 | atomic_t i_writecount; |
| 556 | void *i_security; | 556 | void *i_security; |
| 557 | union { | 557 | void *i_private; /* fs or device private pointer */ |
| 558 | void *generic_ip; | ||
| 559 | } u; | ||
| 560 | #ifdef __NEED_I_SIZE_ORDERED | 558 | #ifdef __NEED_I_SIZE_ORDERED |
| 561 | seqcount_t i_size_seqcount; | 559 | seqcount_t i_size_seqcount; |
| 562 | #endif | 560 | #endif |
diff --git a/kernel/relay.c b/kernel/relay.c index 33345e73485c..85786ff2a4f9 100644 --- a/kernel/relay.c +++ b/kernel/relay.c | |||
| @@ -669,7 +669,7 @@ EXPORT_SYMBOL_GPL(relay_flush); | |||
| 669 | */ | 669 | */ |
| 670 | static int relay_file_open(struct inode *inode, struct file *filp) | 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 | kref_get(&buf->kref); | 673 | kref_get(&buf->kref); |
| 674 | filp->private_data = buf; | 674 | filp->private_data = buf; |
| 675 | 675 | ||
diff --git a/security/inode.c b/security/inode.c index 47eb63480dac..176aacea8ca4 100644 --- a/security/inode.c +++ b/security/inode.c | |||
| @@ -44,8 +44,8 @@ static ssize_t default_write_file(struct file *file, const char __user *buf, | |||
| 44 | 44 | ||
| 45 | static int default_open(struct inode *inode, struct file *file) | 45 | static int default_open(struct inode *inode, struct file *file) |
| 46 | { | 46 | { |
| 47 | if (inode->u.generic_ip) | 47 | if (inode->i_private) |
| 48 | file->private_data = inode->u.generic_ip; | 48 | file->private_data = inode->i_private; |
| 49 | 49 | ||
| 50 | return 0; | 50 | return 0; |
| 51 | } | 51 | } |
| @@ -194,7 +194,7 @@ static int create_by_name(const char *name, mode_t mode, | |||
| 194 | * directory dentry if set. If this paramater is NULL, then the | 194 | * directory dentry if set. If this paramater is NULL, then the |
| 195 | * file will be created in the root of the securityfs filesystem. | 195 | * file will be created in the root of the securityfs filesystem. |
| 196 | * @data: a pointer to something that the caller will want to get to later | 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 | * the open() call. | 198 | * the open() call. |
| 199 | * @fops: a pointer to a struct file_operations that should be used for | 199 | * @fops: a pointer to a struct file_operations that should be used for |
| 200 | * this file. | 200 | * this file. |
| @@ -240,7 +240,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode, | |||
| 240 | if (fops) | 240 | if (fops) |
| 241 | dentry->d_inode->i_fop = fops; | 241 | dentry->d_inode->i_fop = fops; |
| 242 | if (data) | 242 | if (data) |
| 243 | dentry->d_inode->u.generic_ip = data; | 243 | dentry->d_inode->i_private = data; |
| 244 | } | 244 | } |
| 245 | exit: | 245 | exit: |
| 246 | return dentry; | 246 | return dentry; |
