Inode slimming patches, part 1
Subsystems (51)
cover Inode slimming patches, part 1
The following patches are against 2.6.17-mm5, and 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).
- Ted
PATCH 1/8 inode_diet: Replace inode.u.generic_ip with inode.i_private
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.
include/linux/fs.h +1 -3
@@ -549,9 +549,7 @@atomic_t i_writecount;void *i_security; -union { -void *generic_ip; - } u; +void *i_private;/* fs or device private pointer */ #ifdef __NEED_I_SIZE_ORDEREDseqcount_t i_size_seqcount;#endif
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -120,7 +120,7 @@ ret =0 ; inode->i_op = &spufs_file_iops; inode->i_fop = fops; - inode->u.generic_ip =SPUFS_I (inode)->i_ctx =get_spu_context (ctx); + inode->i_private =SPUFS_I (inode)->i_ctx =get_spu_context (ctx);d_add (dentry, inode); out:return ret;
arch/s390/kernel/debug.c +1 -1
@@ -603,7 +603,7 @@debug_info_t *debug_info, *debug_info_snapshot;down (&debug_lock); - debug_info = (struct debug_info *)file->f_dentry->d_inode->u.generic_ip; + debug_info = file->f_dentry->d_inode->i_private;/* find debug view */ for (i =0 ; i <DEBUG_MAX_VIEWS ; i++) {if (!debug_info->views[i])
drivers/i2c/chips/tps65010.c +1 -1
@@ -306,7 +306,7 @@static int dbg_tps_open (struct inode *inode,struct file *file) { -return single_open (file, dbg_show, inode->u.generic_ip); +return single_open (file, dbg_show, inode->i_private); }static struct file_operations debug_fops = {
drivers/infiniband/ulp/ipoib/ipoib_fs.c +2 -2
@@ -141,7 +141,7 @@return ret; seq = file->private_data; - seq->private = inode->u.generic_ip; + seq->private = inode->i_private;return 0 ; }
@@ -247,7 +247,7 @@return ret; seq = file->private_data; - seq->private = inode->u.generic_ip; + seq->private = inode->i_private;return 0 ; }
drivers/misc/ibmasm/ibmasmfs.c +8 -8
@@ -175,7 +175,7 @@ } inode->i_fop = fops; - inode->u.generic_ip = data; + inode->i_private = data;d_add (dentry, inode);return dentry;
@@ -244,7 +244,7 @@ {struct ibmasmfs_command_data *command_data; -if (!inode->u.generic_ip) +if (!inode->i_private)return -ENODEV ; command_data =kmalloc (sizeof (struct ibmasmfs_command_data ),GFP_KERNEL );
@@ -252,7 +252,7 @@return -ENOMEM ; command_data->command =NULL ; - command_data->sp = inode->u.generic_ip; + command_data->sp = inode->i_private; file->private_data = command_data;return 0 ; }
@@ -351,10 +351,10 @@struct ibmasmfs_event_data *event_data;struct service_processor *sp; -if (!inode->u.generic_ip) +if (!inode->i_private)return -ENODEV ; - sp = inode->u.generic_ip; + sp = inode->i_private; event_data =kmalloc (sizeof (struct ibmasmfs_event_data ),GFP_KERNEL );if (!event_data)
@@ -439,14 +439,14 @@ {struct ibmasmfs_heartbeat_data *rhbeat; -if (!inode->u.generic_ip) +if (!inode->i_private)return -ENODEV ; rhbeat =kmalloc (sizeof (struct ibmasmfs_heartbeat_data ),GFP_KERNEL );if (!rhbeat)return -ENOMEM ; - rhbeat->sp = (struct service_processor *)inode->u.generic_ip; + rhbeat->sp = inode->i_private; rhbeat->active =0 ;ibmasm_init_reverse_heartbeat (rhbeat->sp, &rhbeat->heartbeat); file->private_data = rhbeat;
@@ -508,7 +508,7 @@static int remote_settings_file_open (struct inode *inode,struct file *file) { - file->private_data = inode->u.generic_ip; + file->private_data = inode->i_private;return 0 ; }
drivers/net/irda/vlsi_ir.h +1 -1
@@ -58,7 +58,7 @@/* PDE() introduced in 2.5.4 */ #ifdef CONFIG_PROC_FS -#define PDE (inode) ((inode)->u.generic_ip) +#define PDE (inode) ((inode)->i_private)#endif /* irda crc16 calculation exported in 2.5.42 */
drivers/oprofile/oprofilefs.c +5 -5
@@ -110,8 +110,8 @@static int default_open (struct inode * inode,struct file * filp) { -if (inode->u.generic_ip) - filp->private_data = inode->u.generic_ip; +if (inode->i_private) + filp->private_data = inode->i_private;return 0 ; }
@@ -158,7 +158,7 @@if (!d)return -EFAULT ; - d->d_inode->u.generic_ip = val; + d->d_inode->i_private = val;return 0 ; }
@@ -171,7 +171,7 @@if (!d)return -EFAULT ; - d->d_inode->u.generic_ip = val; + d->d_inode->i_private = val;return 0 ; }
@@ -197,7 +197,7 @@if (!d)return -EFAULT ; - d->d_inode->u.generic_ip = val; + d->d_inode->i_private = val;return 0 ; }
drivers/pci/hotplug/cpqphp_sysfs.c +1 -1
@@ -140,7 +140,7 @@static int open (struct inode *inode,struct file *file) { -struct controller *ctrl = inode->u.generic_ip; +struct controller *ctrl = inode->i_private;struct ctrl_dbg *dbg;int retval = -ENOMEM ;
drivers/usb/core/devio.c +1 -1
@@ -555,7 +555,7 @@if (imajor (inode) ==USB_DEVICE_MAJOR ) dev =usbdev_lookup_minor (iminor (inode));if (!dev) - dev = inode->u.generic_ip; + dev = inode->i_private;if (!dev) {kfree (ps); goto out;
drivers/usb/core/inode.c +3 -3
@@ -402,8 +402,8 @@static int default_open (struct inode *inode,struct file *file) { -if (inode->u.generic_ip) - file->private_data = inode->u.generic_ip; +if (inode->i_private) + file->private_data = inode->i_private;return 0 ; }
@@ -509,7 +509,7 @@ }else {if (dentry->d_inode) {if (data) - dentry->d_inode->u.generic_ip = data; + dentry->d_inode->i_private = data;if (fops) dentry->d_inode->i_fop = fops; dentry->d_inode->i_uid = uid;
drivers/usb/gadget/inode.c +3 -3
@@ -844,7 +844,7 @@static int ep_open (struct inode *inode,struct file *fd) { -struct ep_data *data = inode->u.generic_ip; +struct ep_data *data = inode->i_private;int value = -EBUSY ;if (down_interruptible (&data->lock) !=0 )
@@ -1909,7 +1909,7 @@static int dev_open (struct inode *inode,struct file *fd) { -struct dev_data *dev = inode->u.generic_ip; +struct dev_data *dev = inode->i_private;int value = -EBUSY ;if (dev->state ==STATE_DEV_DISABLED ) {
@@ -1970,7 +1970,7 @@ inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; - inode->u.generic_ip = data; + inode->i_private = data; inode->i_fop = fops; }return inode;
drivers/usb/host/isp116x-hcd.c +1 -1
@@ -1204,7 +1204,7 @@static int isp116x_open_seq (struct inode *inode,struct file *file) { -return single_open (file, isp116x_show_dbg, inode->u.generic_ip); +return single_open (file, isp116x_show_dbg, inode->i_private); }static struct file_operations isp116x_debug_fops = {
drivers/usb/host/uhci-debug.c +1 -1
@@ -428,7 +428,7 @@static int uhci_debug_open (struct inode *inode,struct file *file) { -struct uhci_hcd *uhci = inode->u.generic_ip; +struct uhci_hcd *uhci = inode->i_private;struct uhci_debug *up;int ret = -ENOMEM ;unsigned long flags;
drivers/usb/mon/mon_stat.c +1 -1
@@ -28,7 +28,7 @@if ((sp =kmalloc (sizeof (struct snap ),GFP_KERNEL )) ==NULL )return -ENOMEM ; - mbus = inode->u.generic_ip; + mbus = inode->i_private; sp->slen = snprintf(sp->str, STAT_BUF_SIZE, "nreaders %d events %u text_lost %u\n",
drivers/usb/mon/mon_text.c +2 -2
@@ -238,7 +238,7 @@int rc;mutex_lock (&mon_lock); - mbus = inode->u.generic_ip; + mbus = inode->i_private; ubus = mbus->u_bus; rp =kzalloc (sizeof (struct mon_reader_text ),GFP_KERNEL );
@@ -401,7 +401,7 @@struct mon_event_text *ep;mutex_lock (&mon_lock); - mbus = inode->u.generic_ip; + mbus = inode->i_private;if (mbus->nreaders <=0 ) { printk(KERN_ERR TAG ": consistency error on close\n");
fs/autofs/inode.c +1 -1
@@ -241,7 +241,7 @@ inode->i_op = &autofs_symlink_inode_operations; sl = &sbi->symlink[n]; - inode->u.generic_ip = sl; + inode->i_private = sl; inode->i_mode =S_IFLNK |S_IRWXUGO ; inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = sl->mtime; inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec =0 ;
fs/autofs/symlink.c +1 -1
@@ -15,7 +15,7 @@/* Nothing to release.. */ static void *autofs_follow_link (struct dentry *dentry,struct nameidata *nd) { -char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; +char *s=((struct autofs_symlink *)dentry->d_inode->i_private)->data;nd_set_link (nd, s);return NULL ; }
fs/binfmt_misc.c +4 -4
@@ -517,7 +517,7 @@static void bm_clear_inode (struct inode *inode) { -kfree (inode->u.generic_ip); +kfree (inode->i_private); }static void kill_node (Node *e)
@@ -545,7 +545,7 @@static ssize_t bm_entry_read (struct file * file,char __user * buf,size_t nbytes,loff_t *ppos) { -Node *e = file->f_dentry->d_inode->u.generic_ip; +Node *e = file->f_dentry->d_inode->i_private;loff_t pos = *ppos;ssize_t res;char *page;
@@ -579,7 +579,7 @@ size_t count, loff_t *ppos) { struct dentry *root; -Node *e = file->f_dentry->d_inode->u.generic_ip; +Node *e = file->f_dentry->d_inode->i_private;int res =parse_command (buffer, count);switch (res) {
@@ -646,7 +646,7 @@ } e->dentry =dget (dentry); - inode->u.generic_ip = e; + inode->i_private = e; inode->i_fop = &bm_entry_operations;d_instantiate (dentry, inode);
fs/debugfs/file.c +2 -2
@@ -32,8 +32,8 @@static int default_open (struct inode *inode,struct file *file) { -if (inode->u.generic_ip) - file->private_data = inode->u.generic_ip; +if (inode->i_private) + file->private_data = inode->i_private;return 0 ; }
fs/debugfs/inode.c +2 -2
@@ -169,7 +169,7 @@* directory dentry if set. If this paramater is NULL, then the * file will be created in the root of the debugfs filesystem. * @data: a pointer to something that the caller will want to get to later -* on. The inode.u.generic_ip pointer will point to this value on +* on. The inode.i_private pointer will point to this value on * the open() call. * @fops: a pointer to a struct file_operations that should be used for * this file.
@@ -210,7 +210,7 @@if (dentry->d_inode) {if (data) - dentry->d_inode->u.generic_ip = data; + dentry->d_inode->i_private = data;if (fops) dentry->d_inode->i_fop = fops; }
fs/devpts/inode.c +2 -2
@@ -177,7 +177,7 @@ inode->i_gid = config.setgid ? config.gid : current->fsgid; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ;init_special_inode (inode,S_IFCHR |config.mode, device); - inode->u.generic_ip = tty; + inode->i_private = tty; dentry =get_node (number);if (!IS_ERR (dentry) && !dentry->d_inode)
@@ -196,7 +196,7 @@ tty =NULL ;if (!IS_ERR (dentry)) {if (dentry->d_inode) - tty = dentry->d_inode->u.generic_ip; + tty = dentry->d_inode->i_private;dput (dentry); }
fs/freevxfs/vxfs.h +1 -1
@@ -252,7 +252,7 @@* Get filesystem private data from VFS inode. */ #define VXFS_INO (ip) \ - ((struct vxfs_inode_info *)(ip)->u.generic_ip) + ((struct vxfs_inode_info *)(ip)->i_private)/* * Get filesystem private data from VFS superblock.
fs/freevxfs/vxfs_inode.c +2 -2
@@ -243,7 +243,7 @@ ip->i_blocks = vip->vii_blocks; ip->i_generation = vip->vii_gen; - ip->u.generic_ip = (void *)vip; + ip->i_private = vip; }
@@ -338,5 +338,5 @@void vxfs_clear_inode (struct inode *ip) { -kmem_cache_free (vxfs_inode_cachep, ip->u.generic_ip); +kmem_cache_free (vxfs_inode_cachep, ip->i_private); }
fs/jffs/inode-v23.c +17 -17
@@ -369,7 +369,7 @@ f =jffs_find_file (c, raw_inode->ino); - inode->u.generic_ip = (void *)f; + inode->i_private = (void *)f;insert_inode_hash (inode);return inode;
@@ -442,7 +442,7 @@ }); result = -ENOTDIR ; -if (!(old_dir_f = (struct jffs_file *)old_dir->u.generic_ip)) { +if (!(old_dir_f = old_dir->i_private)) {D (printk ("jffs_rename(): Old dir invalid.\n" )); goto jffs_rename_end; }
@@ -456,7 +456,7 @@/* Find the new directory. */ result = -ENOTDIR ; -if (!(new_dir_f = (struct jffs_file *)new_dir->u.generic_ip)) { +if (!(new_dir_f = new_dir->i_private)) {D (printk ("jffs_rename(): New dir invalid.\n" )); goto jffs_rename_end; }
@@ -593,7 +593,7 @@ }else { ddino = ((struct jffs_file *) - inode->u.generic_ip)->pino; + inode->i_private)->pino; }D3 (printk ("jffs_readdir(): \"..\" %u\n" , ddino));if (filldir (dirent,".." ,2 , filp->f_pos, ddino,DT_DIR ) <0 ) {
@@ -604,7 +604,7 @@ } filp->f_pos++; } - f = ((struct jffs_file *)inode->u.generic_ip)->children; + f = ((struct jffs_file *)inode->i_private)->children; j =2 ;while (f && (f->deleted || j++ < filp->f_pos )) {
@@ -668,7 +668,7 @@ } r = -EACCES ; -if (!(d = (struct jffs_file *)dir->u.generic_ip)) { +if (!(d = (struct jffs_file *)dir->i_private)) {D (printk ("jffs_lookup(): No such inode! (%lu)\n" , dir->i_ino)); goto jffs_lookup_end;
@@ -739,7 +739,7 @@unsigned long read_len;int result;struct inode *inode = (struct inode *)page->mapping->host; -struct jffs_file *f = (struct jffs_file *)inode->u.generic_ip; +struct jffs_file *f = (struct jffs_file *)inode->i_private;struct jffs_control *c = (struct jffs_control *)inode->i_sb->s_fs_info;int r;loff_t offset;
@@ -828,7 +828,7 @@ });lock_kernel (); - dir_f = (struct jffs_file *)dir->u.generic_ip; + dir_f = dir->i_private; ASSERT(if (!dir_f) { printk(KERN_ERR "jffs_mkdir(): No reference to a "
@@ -972,7 +972,7 @@kfree (_name); }); - dir_f = (struct jffs_file *) dir->u.generic_ip; + dir_f = dir->i_private; c = dir_f->c; result = -ENOENT ;
@@ -1082,7 +1082,7 @@if (!old_valid_dev (rdev))return -EINVAL ;lock_kernel (); - dir_f = (struct jffs_file *)dir->u.generic_ip; + dir_f = dir->i_private; c = dir_f->c;D3 (printk (KERN_NOTICE "mknod(): down biglock\n" ));
@@ -1186,7 +1186,7 @@kfree (_symname); }); - dir_f = (struct jffs_file *)dir->u.generic_ip; + dir_f = dir->i_private; ASSERT(if (!dir_f) { printk(KERN_ERR "jffs_symlink(): No reference to a " "jffs_file struct in inode.\n");
@@ -1289,7 +1289,7 @@kfree (s); }); - dir_f = (struct jffs_file *)dir->u.generic_ip; + dir_f = dir->i_private; ASSERT(if (!dir_f) { printk(KERN_ERR "jffs_create(): No reference to a " "jffs_file struct in inode.\n");
@@ -1403,9 +1403,9 @@ goto out_isem; } -if (!(f = (struct jffs_file *)inode->u.generic_ip)) { -D (printk ("jffs_file_write(): inode->u.generic_ip = 0x%p\n" , - inode->u.generic_ip)); +if (!(f = inode->i_private)) { +D (printk ("jffs_file_write(): inode->i_private = 0x%p\n" , + inode->i_private)); goto out_isem; }
@@ -1693,7 +1693,7 @@mutex_unlock (&c->fmc->biglock);return ; } - inode->u.generic_ip = (void *)f; + inode->i_private = f; inode->i_mode = f->mode; inode->i_nlink = f->nlink; inode->i_uid = f->uid;
@@ -1748,7 +1748,7 @@lock_kernel (); inode->i_size =0 ; inode->i_blocks =0 ; - inode->u.generic_ip =NULL ; + inode->i_private =NULL ;clear_inode (inode);if (inode->i_nlink ==0 ) { c = (struct jffs_control *) inode->i_sb->s_fs_info;
fs/libfs.c +1 -1
@@ -547,7 +547,7 @@ attr->get = get; attr->set = set; - attr->data = inode->u.generic_ip; + attr->data = inode->i_private; attr->fmt = fmt;mutex_init (&attr->mutex);
fs/ocfs2/dlmglue.c +1 -1
@@ -1995,7 +1995,7 @@mlog_errno (ret); goto out; } - osb = (struct ocfs2_super *) inode->u.generic_ip; + osb = inode->i_private;ocfs2_get_dlm_debug (osb->osb_dlm_debug); priv->p_dlm_debug = osb->osb_dlm_debug;INIT_LIST_HEAD (&priv->p_iter_res.l_debug_list);
security/inode.c +4 -4
@@ -44,8 +44,8 @@static int default_open (struct inode *inode,struct file *file) { -if (inode->u.generic_ip) - file->private_data = inode->u.generic_ip; +if (inode->i_private) + file->private_data = inode->i_private;return 0 ; }
@@ -194,7 +194,7 @@* directory dentry if set. If this paramater is NULL, then the * file will be created in the root of the securityfs filesystem. * @data: a pointer to something that the caller will want to get to later -* on. The inode.u.generic_ip pointer will point to this value on +* on. The inode.i_private pointer will point to this value on * the open() call. * @fops: a pointer to a struct file_operations that should be used for * this file.
@@ -240,7 +240,7 @@if (fops) dentry->d_inode->i_fop = fops;if (data) - dentry->d_inode->u.generic_ip = data; + dentry->d_inode->i_private = data; } exit:return dentry;
fs/inode.c +1 -1
@@ -163,7 +163,7 @@ bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; mapping->backing_dev_info = bdi; } -memset (&inode->u,0 ,sizeof (inode->u)); + inode->i_private =0 ; inode->i_mapping = mapping; }return inode;
block/blktrace.c +1 -1
@@ -214,7 +214,7 @@static int blk_dropped_open (struct inode *inode,struct file *filp) { - filp->private_data = inode->u.generic_ip; + filp->private_data = inode->i_private;return 0 ; }
drivers/infiniband/hw/ipath/ipath_fs.c +6 -6
@@ -64,7 +64,7 @@ inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; - inode->u.generic_ip = data; + inode->i_private = data;if ((mode &S_IFMT ) ==S_IFDIR ) { inode->i_op = &simple_dir_inode_operations; inode->i_nlink++;
@@ -119,7 +119,7 @@u16 i;struct ipath_devdata *dd; - dd = file->f_dentry->d_inode->u.generic_ip; + dd = file->f_dentry->d_inode->i_private;for (i =0 ; i <NUM_COUNTERS ; i++) counters[i] =ipath_snap_cntr (dd, i);
@@ -139,7 +139,7 @@struct ipath_devdata *dd;u64 guid; - dd = file->f_dentry->d_inode->u.generic_ip; + dd = file->f_dentry->d_inode->i_private; guid =be64_to_cpu (dd->ipath_guid);
@@ -178,7 +178,7 @@u32 tmp, tmp2;struct ipath_devdata *dd; - dd = file->f_dentry->d_inode->u.generic_ip; + dd = file->f_dentry->d_inode->i_private;/* so we only initialize non-zero fields. */ memset (portinfo,0 ,sizeof portinfo);
@@ -325,7 +325,7 @@ goto bail; } - dd = file->f_dentry->d_inode->u.generic_ip; + dd = file->f_dentry->d_inode->i_private;if (ipath_eeprom_read (dd, pos, tmp, count)) {ipath_dev_err (dd,"failed to read from flash\n" ); ret = -ENXIO ;
@@ -381,7 +381,7 @@ goto bail_tmp; } - dd = file->f_dentry->d_inode->u.generic_ip; + dd = file->f_dentry->d_inode->i_private;if (ipath_eeprom_write (dd, pos, tmp, count)) { ret = -ENXIO ;ipath_dev_err (dd,"failed to write to flash\n" );
drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c +1 -1
@@ -54,7 +54,7 @@static int open_file_generic (struct inode *inode,struct file *file) { - file->private_data = inode->u.generic_ip; + file->private_data = inode->i_private;return 0 ; }
kernel/relay.c +1 -1
@@ -669,7 +669,7 @@*/ static int relay_file_open (struct inode *inode,struct file *filp) { -struct rchan_buf *buf = inode->u.generic_ip; +struct rchan_buf *buf = inode->i_private;kref_get (&buf->kref); filp->private_data = buf;
arch/s390/hypfs/inode.c +3 -3
@@ -104,13 +104,13 @@static void hypfs_drop_inode (struct inode *inode) { -kfree (inode->u.generic_ip); +kfree (inode->i_private);generic_delete_inode (inode); }static int hypfs_open (struct inode *inode,struct file *filp) { -char *data = filp->f_dentry->d_inode->u.generic_ip; +char *data = filp->f_dentry->d_inode->i_private;struct hypfs_sb_info *fs_info;if (filp->f_mode &FMODE_WRITE ) {
@@ -350,7 +350,7 @@ parent->d_inode->i_nlink++; }else BUG (); - inode->u.generic_ip = data; + inode->i_private = data;d_instantiate (dentry, inode);dget (dentry);return dentry;
fs/dlm/debug_fs.c +1 -1
@@ -254,7 +254,7 @@return ret; seq = file->private_data; - seq->private = inode->u.generic_ip; + seq->private = inode->i_private;return 0 ; }
fs/ecryptfs/ecryptfs_kernel.h +4 -4
@@ -288,25 +288,25 @@static inline struct ecryptfs_inode_info *ecryptfs_inode_to_private (struct inode *inode) { -return (struct ecryptfs_inode_info *)inode->u.generic_ip; +return (struct ecryptfs_inode_info *)inode->i_private; }static inline void ecryptfs_set_inode_private (struct inode *inode,struct ecryptfs_inode_info *inode_info) { - inode->u.generic_ip = inode_info; + inode->i_private = inode_info; }static inline struct inode *ecryptfs_inode_to_lower (struct inode *inode) { -return ((struct ecryptfs_inode_info *)inode->u.generic_ip)->wii_inode; +return ((struct ecryptfs_inode_info *)inode->i_private)->wii_inode; }static inline void ecryptfs_set_inode_lower (struct inode *inode,struct inode *lower_inode) { - ((struct ecryptfs_inode_info *)inode->u.generic_ip)->wii_inode = + ((struct ecryptfs_inode_info *)inode->i_private)->wii_inode = lower_inode; }
fs/ecryptfs/super.c +1 -1
@@ -86,7 +86,7 @@static void ecryptfs_read_inode (struct inode *inode) {/* This is where we setup the self-reference in the vfs_inode's -* u.generic_ip. That way we don't have to walk the list again. */ +* i_private. That way we don't have to walk the list again. */ ecryptfs_set_inode_private (inode, list_entry(inode, struct ecryptfs_inode_info, vfs_inode));
fs/fuse/control.c +3 -3
@@ -23,7 +23,7 @@ {struct fuse_conn *fc;mutex_lock (&fuse_mutex); - fc = file->f_dentry->d_inode->u.generic_ip; + fc = file->f_dentry->d_inode->i_private;if (fc) fc =fuse_conn_get (fc);mutex_unlock (&fuse_mutex);
@@ -98,7 +98,7 @@ inode->i_op = iop; inode->i_fop = fop; inode->i_nlink = nlink; - inode->u.generic_ip = fc; + inode->i_private = fc;d_add (dentry, inode);return dentry; }
@@ -150,7 +150,7 @@for (i = fc->ctl_ndents -1 ; i >=0 ; i--) {struct dentry *dentry = fc->ctl_dentry[i]; - dentry->d_inode->u.generic_ip =NULL ; + dentry->d_inode->i_private =NULL ;d_drop (dentry);dput (dentry); }
fs/gfs2/inode.c +1 -1
@@ -169,7 +169,7 @@if (inode->i_state &I_NEW ) {struct gfs2_sbd *sdp =GFS2_SB (inode);umode_t mode =DT2IF (type); - inode->u.generic_ip = ip; + inode->i_private = ip; inode->i_mode = mode;if (S_ISREG (mode)) {
fs/gfs2/meta_io.c +1 -1
@@ -186,7 +186,7 @@mapping_set_gfp_mask (aspace->i_mapping,GFP_KERNEL ); aspace->i_mapping->a_ops = &aspace_aops; aspace->i_size = ~0ULL ; - aspace->u.generic_ip =NULL ; + aspace->i_private =NULL ;insert_inode_hash (aspace); }return aspace;
fs/gfs2/ops_super.c +3 -3
@@ -55,7 +55,7 @@struct gfs2_inode *ip =GFS2_I (inode);/* Check this is a "normal" inode */ -if (inode->u.generic_ip) { +if (inode->i_private) {if (current->flags &PF_MEMALLOC )return 0 ;if (sync)
@@ -283,7 +283,7 @@* serves to contain an address space (see rgrp.c, meta_io.c) * which therefore doesn't have its own glocks. */ -if (inode->u.generic_ip) { +if (inode->i_private) {struct gfs2_inode *ip =GFS2_I (inode);gfs2_glock_inode_squish (inode);gfs2_assert (inode->i_sb->s_fs_info, ip->i_gl->gl_state ==LM_ST_UNLOCKED );
@@ -384,7 +384,7 @@struct gfs2_holder gh;int error; -if (!inode->u.generic_ip) +if (!inode->i_private) goto out; error =gfs2_glock_nq_init (ip->i_gl,LM_ST_EXCLUSIVE ,LM_FLAG_TRY_1CB |GL_NOCACHE , &gh);
fs/reiser4/inode.h +1 -1
@@ -41,7 +41,7 @@REISER4_IMMUTABLE =2 ,/* inode was read from storage */ REISER4_LOADED =3 , -/* this bit is set for symlinks. inode->u.generic_ip points to target +/* this bit is set for symlinks. inode->i_private points to target name of symlink. */ REISER4_GENERIC_PTR_USED = 4,/* set if size of stat-data item for this inode is known. If this is
fs/reiser4/plugin/file/symlink.c +7 -7
@@ -42,8 +42,8 @@*/ reiser4_inode_data (symlink)->extmask |= (1 <<SYMLINK_STAT ); -assert ("vs-838" , symlink->u.generic_ip ==NULL ); - symlink->u.generic_ip = (void *)data->name; +assert ("vs-838" , symlink->i_private ==NULL ); + symlink->i_private = (void *)data->name;assert ("vs-843" , symlink->i_size ==0 );INODE_SET_FIELD (symlink, i_size,strlen (data->name));
@@ -51,14 +51,14 @@/* insert stat data appended with data->name */ result =inode_file_plugin (symlink)->write_sd_by_inode (symlink);if (result) { -/* FIXME-VS: Make sure that symlink->u.generic_ip is not attached +/* FIXME-VS: Make sure that symlink->i_private is not attached to kmalloced data */ INODE_SET_FIELD (symlink, i_size,0 ); }else { -assert ("vs-849" , symlink->u.generic_ip +assert ("vs-849" , symlink->i_private &&inode_get_flag (symlink,REISER4_GENERIC_PTR_USED ));assert ("vs-850" , - !memcmp ((char *)symlink->u.generic_ip, data->name, + !memcmp ((char *)symlink->i_private, data->name, (size_t ) symlink->i_size +1 )); }return result;
@@ -76,8 +76,8 @@assert ("edward-801" ,inode_get_flag (inode,REISER4_GENERIC_PTR_USED ));assert ("vs-839" ,S_ISLNK (inode->i_mode)); -kfree (inode->u.generic_ip); - inode->u.generic_ip =NULL ; +kfree (inode->i_private); + inode->i_private =NULL ;inode_clr_flag (inode,REISER4_GENERIC_PTR_USED ); }
fs/reiser4/plugin/inode_ops.c +3 -3
@@ -389,16 +389,16 @@* * This is common implementation of vfs's followlink method of struct * inode_operations. -* Assumes that inode's generic_ip points to the content of symbolic link. +* Assumes that inode's i_private points to the content of symbolic link. */ void *follow_link_common (struct dentry *dentry,struct nameidata *nd) {assert ("vs-851" ,S_ISLNK (dentry->d_inode->i_mode)); -if (!dentry->d_inode->u.generic_ip +if (!dentry->d_inode->i_private || !inode_get_flag (dentry->d_inode,REISER4_GENERIC_PTR_USED ))return ERR_PTR (RETERR (-EINVAL )); -nd_set_link (nd, dentry->d_inode->u.generic_ip); +nd_set_link (nd, dentry->d_inode->i_private);return NULL ; }
fs/reiser4/plugin/item/static_stat.c +9 -9
@@ -430,21 +430,21 @@/* symlink stat data extension */ -/* allocate memory for symlink target and attach it to inode->u.generic_ip */ +/* allocate memory for symlink target and attach it to inode->i_private */ static int symlink_target_to_inode (struct inode *inode,const char *target,int len) { -assert ("vs-845" , inode->u.generic_ip ==NULL ); +assert ("vs-845" , inode->i_private ==NULL );assert ("vs-846" , !inode_get_flag (inode,REISER4_GENERIC_PTR_USED ));/* FIXME-VS: this is prone to deadlock. Not more than other similar places, though */ - inode->u.generic_ip =kmalloc ((size_t ) len +1 ,get_gfp_mask ()); -if (!inode->u.generic_ip) + inode->i_private =kmalloc ((size_t ) len +1 ,get_gfp_mask ()); +if (!inode->i_private)return RETERR (-ENOMEM ); -memcpy ((char *)(inode->u.generic_ip), target, (size_t ) len); - ((char *)(inode->u.generic_ip))[len] =0 ; +memcpy ((char *)(inode->i_private), target, (size_t ) len); + ((char *)(inode->i_private))[len] =0 ;inode_set_flag (inode,REISER4_GENERIC_PTR_USED );return 0 ; }
@@ -499,8 +499,8 @@if (!inode_get_flag (inode,REISER4_GENERIC_PTR_USED )) {const char *target; - target = (const char *)(inode->u.generic_ip); - inode->u.generic_ip =NULL ; + target = (const char *)(inode->i_private); + inode->i_private =NULL ; result =symlink_target_to_inode (inode, target, length);
@@ -510,7 +510,7 @@ }else {/* there is nothing to do in update but move area */ assert ("vs-844" , - !memcmp (inode->u.generic_ip, sd->body, + !memcmp (inode->i_private, sd->body, (size_t ) length +1 )); }
lib/statistic.c +2 -2
@@ -666,7 +666,7 @@ struct file *file, struct statistic_interface **interface, struct statistic_file_private **private) { - *interface = inode->u.generic_ip; + *interface = inode->i_private;BUG_ON (!interface); *private =kzalloc (sizeof (struct statistic_file_private ),GFP_KERNEL );if (unlikely (!*private))
@@ -749,7 +749,7 @@static int statistic_def_close (struct inode *inode,struct file *file) { -struct statistic_interface *interface = inode->u.generic_ip; +struct statistic_interface *interface = inode->i_private;struct statistic_file_private *private = file->private_data;struct sgrb_seg *seg, *seg_nl;int offset;
--
PATCH 2/8 inode-diet: Move i_pipe into a union
In reply to Theodore Ts'oMove the i_pipe pointer into a union that will be shared with i_bdev and i_cdev.
include/linux/fs.h +3 -2
@@ -523,9 +523,10 @@#ifdef CONFIG_QUOTA struct dquot *i_dquot[MAXQUOTAS ];#endif -/* These three should probably be a union */ struct list_head i_devices; -struct pipe_inode_info *i_pipe; +union { +struct pipe_inode_info *i_pipe; + };struct block_device *i_bdev;struct cdev *i_cdev;int i_cindex;
--
PATCH 3/8 inode-diet: Move i_bdev into a union
In reply to Theodore Ts'oMove the i_bdev pointer in struct inode into a union.
include/linux/fs.h +1 -1
@@ -526,8 +526,8 @@struct list_head i_devices;union {struct pipe_inode_info *i_pipe; +struct block_device *i_bdev; }; -struct block_device *i_bdev;struct cdev *i_cdev;int i_cindex;
fs/inode.c +1 -1
@@ -254,7 +254,7 @@DQUOT_DROP (inode);if (inode->i_sb && inode->i_sb->s_op->clear_inode) inode->i_sb->s_op->clear_inode (inode); -if (inode->i_bdev) +if (S_ISBLK (inode->i_mode) && inode->i_bdev)bd_forget (inode);if (inode->i_cdev)cd_forget (inode);
--
PATCH 4/8 inode-diet: Move i_cdev into a union
In reply to Theodore Ts'oMove the i_cdev pointer in struct inode into a union.
include/linux/fs.h +1 -1
@@ -527,8 +527,8 @@union {struct pipe_inode_info *i_pipe;struct block_device *i_bdev; +struct cdev *i_cdev; }; -struct cdev *i_cdev;int i_cindex;__u32 i_generation;
fs/file_table.c +1 -1
@@ -176,7 +176,7 @@if (file->f_op && file->f_op->release) file->f_op->release (inode, file);security_file_free (file); -if (unlikely (inode->i_cdev !=NULL )) +if (unlikely (S_ISCHR (inode->i_mode) && inode->i_cdev !=NULL ))cdev_put (inode->i_cdev);fops_put (file->f_op);if (file->f_mode &FMODE_WRITE )
fs/inode.c +1 -1
@@ -256,7 +256,7 @@ inode->i_sb->s_op->clear_inode (inode);if (S_ISBLK (inode->i_mode) && inode->i_bdev)bd_forget (inode); -if (inode->i_cdev) +if (S_ISCHR (inode->i_mode) && inode->i_cdev)cd_forget (inode); inode->i_state =I_CLEAR ; }
--
PATCH 5/8 inode-diet: Eliminate i_blksize and use a per-superblock default
In reply to Theodore Ts'oThis eliminates the i_blksize field from struct inode. Filesystems that want to provide a per-inode st_blksize can do so by providing their own getattr routine instead of using the generic_fillattr() function.
Note that some filesystems were providing pretty much random (and incorrect) values for i_blksize.
include/linux/fs.h +0 -1
@@ -507,7 +507,6 @@struct timespec i_mtime;struct timespec i_ctime;unsigned int i_blkbits; -unsigned long i_blksize;unsigned long i_version;blkcnt_t i_blocks;unsigned short i_bytes;
fs/stat.c +2 -1
@@ -14,6 +14,7 @@#include <linux/namei.h> #include <linux/security.h> #include <linux/syscalls.h> +#include <linux/pagemap.h> #include <asm/uaccess.h> #include <asm/unistd.h>
@@ -32,7 +33,7 @@ stat->ctime = inode->i_ctime; stat->size =i_size_read (inode); stat->blocks = inode->i_blocks; - stat->blksize = inode->i_blksize; + stat->blksize =PAGE_CACHE_SIZE ; }EXPORT_SYMBOL (generic_fillattr);
fs/binfmt_misc.c +0 -1
@@ -507,7 +507,6 @@ inode->i_mode = mode; inode->i_uid =0 ; inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =current_fs_time (inode->i_sb);
fs/eventpoll.c +0 -1
@@ -1590,7 +1590,6 @@ inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; - inode->i_blksize =PAGE_SIZE ;return inode; eexit_1:
fs/libfs.c +0 -2
@@ -383,7 +383,6 @@return -ENOMEM ; inode->i_mode =S_IFDIR |0755 ; inode->i_uid = inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; inode->i_op = &simple_dir_inode_operations;
@@ -405,7 +404,6 @@ goto out; inode->i_mode =S_IFREG | files->mode; inode->i_uid = inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; inode->i_fop = files->ops;
fs/pipe.c +0 -1
@@ -879,7 +879,6 @@ inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; - inode->i_blksize =PAGE_SIZE ;return inode;
arch/powerpc/platforms/cell/spufs/inode.c +0 -1
@@ -82,7 +82,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; out:
drivers/isdn/capi/capifs.c +0 -2
@@ -104,7 +104,6 @@ inode->i_ino =1 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; inode->i_blocks =0 ; - inode->i_blksize =1024 ; inode->i_uid = inode->i_gid =0 ; inode->i_mode =S_IFDIR |S_IRUGO |S_IXUGO |S_IWUSR ; inode->i_op = &simple_dir_inode_operations;
@@ -149,7 +148,6 @@if (!inode)return ; inode->i_ino = number+2 ; - inode->i_blksize =1024 ; inode->i_uid = config.setuid ? config.uid : current->fsuid; inode->i_gid = config.setgid ? config.gid : current->fsgid; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ;
drivers/misc/ibmasm/ibmasmfs.c +0 -1
@@ -147,7 +147,6 @@if (ret) { ret->i_mode = mode; ret->i_uid = ret->i_gid =0 ; - ret->i_blksize =PAGE_CACHE_SIZE ; ret->i_blocks =0 ; ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ; }
drivers/oprofile/oprofilefs.c +0 -1
@@ -31,7 +31,6 @@ inode->i_mode = mode; inode->i_uid =0 ; inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; }
drivers/usb/core/inode.c +0 -1
@@ -249,7 +249,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;switch (mode &S_IFMT ) {
drivers/usb/gadget/inode.c +0 -1
@@ -1966,7 +1966,6 @@ inode->i_mode = mode; inode->i_uid = default_uid; inode->i_gid = default_gid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;
fs/9p/vfs_inode.c +1 -3
@@ -204,7 +204,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize = sb->s_blocksize; inode->i_blocks =0 ; inode->i_rdev =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;
@@ -950,9 +949,8 @@ inode->i_size = stat->length; - inode->i_blksize = sb->s_blocksize; inode->i_blocks = - (inode->i_size + inode->i_blksize -1 ) >> sb->s_blocksize_bits; + (inode->i_size + sb->s_blocksize -1 ) >> sb->s_blocksize_bits; }/**
fs/adfs/inode.c +0 -1
@@ -269,7 +269,6 @@ inode->i_ino = obj->file_id; inode->i_size = obj->size; inode->i_nlink =2 ; - inode->i_blksize =PAGE_SIZE ; inode->i_blocks = (inode->i_size + sb->s_blocksize -1 ) >> sb->s_blocksize_bits;
fs/afs/inode.c +0 -1
@@ -72,7 +72,6 @@ inode->i_ctime.tv_sec = vnode->status.mtime_server; inode->i_ctime.tv_nsec =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_version = vnode->fid.unique; inode->i_mapping->a_ops = &afs_fs_aops;
fs/autofs/inode.c +0 -1
@@ -216,7 +216,6 @@ inode->i_nlink =2 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; inode->i_blocks =0 ; - inode->i_blksize =1024 ;if ( ino ==AUTOFS_ROOT_INO ) { inode->i_mode =S_IFDIR |S_IRUGO |S_IXUGO |S_IWUSR ;
fs/autofs4/inode.c +0 -1
@@ -446,7 +446,6 @@ inode->i_uid =0 ; inode->i_gid =0 ; } - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;
fs/befs/linuxvfs.c +0 -1
@@ -365,7 +365,6 @@ inode->i_mtime.tv_nsec =0 ;/* lower 16 bits are not a time */ inode->i_ctime = inode->i_mtime; inode->i_atime = inode->i_mtime; - inode->i_blksize = befs_sb->block_size; befs_ino->i_inode_num =fsrun_to_cpu (sb, raw_inode->inode_num); befs_ino->i_parent =fsrun_to_cpu (sb, raw_inode->parent);
fs/bfs/dir.c +1 -1
@@ -102,7 +102,7 @@ inode->i_uid = current->fsuid; inode->i_gid = (dir->i_mode &S_ISGID ) ? dir->i_gid : current->fsgid; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ; inode->i_op = &bfs_file_inops; inode->i_fop = &bfs_file_operations; inode->i_mapping->a_ops = &bfs_aops;
fs/bfs/inode.c +0 -1
@@ -76,7 +76,6 @@ inode->i_size =BFS_FILESIZE (di); inode->i_blocks =BFS_FILEBLOCKS (di);if (inode->i_size || inode->i_blocks)dprintf ("Registered inode with %lld size, %ld blocks\n" , inode->i_size, inode->i_blocks); - inode->i_blksize =PAGE_SIZE ; inode->i_atime.tv_sec =le32_to_cpu (di->i_atime); inode->i_mtime.tv_sec =le32_to_cpu (di->i_mtime); inode->i_ctime.tv_sec =le32_to_cpu (di->i_ctime);
fs/configfs/inode.c +0 -1
@@ -136,7 +136,6 @@ {struct inode * inode =new_inode (configfs_sb);if (inode) { - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->a_ops = &configfs_aops; inode->i_mapping->backing_dev_info = &configfs_backing_dev_info;
fs/cramfs/inode.c +0 -1
@@ -73,7 +73,6 @@ inode->i_uid = cramfs_inode->uid; inode->i_size = cramfs_inode->size; inode->i_blocks = (cramfs_inode->size -1 ) /512 +1 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_gid = cramfs_inode->gid;/* Struct copy intentional */ inode->i_mtime = inode->i_atime = inode->i_ctime = zerotime;
fs/debugfs/inode.c +0 -1
@@ -40,7 +40,6 @@ inode->i_mode = mode; inode->i_uid =0 ; inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;switch (mode &S_IFMT ) {
fs/devpts/inode.c +0 -2
@@ -113,7 +113,6 @@ inode->i_ino =1 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; inode->i_blocks =0 ; - inode->i_blksize =1024 ; inode->i_uid = inode->i_gid =0 ; inode->i_mode =S_IFDIR |S_IRUGO |S_IXUGO |S_IWUSR ; inode->i_op = &simple_dir_inode_operations;
@@ -172,7 +171,6 @@return -ENOMEM ; inode->i_ino = number+2 ; - inode->i_blksize =1024 ; inode->i_uid = config.setuid ? config.uid : current->fsuid; inode->i_gid = config.setgid ? config.gid : current->fsgid; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ;
fs/ext2/ialloc.c +0 -1
@@ -574,7 +574,6 @@ inode->i_mode = mode; inode->i_ino = ino; - inode->i_blksize =PAGE_SIZE ;/* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks =0 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ;memset (ei->i_data,0 ,sizeof (ei->i_data));
fs/ext2/inode.c +0 -1
@@ -1094,7 +1094,6 @@brelse (bh); goto bad_inode; } - inode->i_blksize =PAGE_SIZE ;/* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks =le32_to_cpu (raw_inode->i_blocks); ei->i_flags =le32_to_cpu (raw_inode->i_flags); ei->i_faddr =le32_to_cpu (raw_inode->i_faddr);
fs/ext3/ialloc.c +0 -1
@@ -559,7 +559,6 @@ inode->i_ino = ino;/* This is the optimal IO size (for stat), not the fs block size */ - inode->i_blksize =PAGE_SIZE ; inode->i_blocks =0 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ;
fs/ext3/inode.c +0 -3
@@ -2628,9 +2628,6 @@* recovery code: that's fine, we're about to complete * the process of deleting those. */ } - inode->i_blksize =PAGE_SIZE ;/* This is the optimal IO size -* (for stat), not the fs block -* size */ inode->i_blocks =le32_to_cpu (raw_inode->i_blocks); ei->i_flags =le32_to_cpu (raw_inode->i_flags);#ifdef EXT3_FRAGMENTS
fs/fat/inode.c +0 -3
@@ -375,8 +375,6 @@ inode->i_flags |=S_IMMUTABLE ; }MSDOS_I (inode)->i_attrs = de->attr &ATTR_UNUSED ; -/* this is as close to the truth as we can get ... */ - inode->i_blksize = sbi->cluster_size; inode->i_blocks = ((inode->i_size + (sbi->cluster_size -1 )) & ~((loff_t )sbi->cluster_size -1 )) >>9 ; inode->i_mtime.tv_sec =
@@ -1137,7 +1135,6 @@MSDOS_I (inode)->i_start =0 ; inode->i_size = sbi->dir_entries *sizeof (struct msdos_dir_entry ); } - inode->i_blksize = sbi->cluster_size; inode->i_blocks = ((inode->i_size + (sbi->cluster_size -1 )) & ~((loff_t )sbi->cluster_size -1 )) >>9 ;MSDOS_I (inode)->i_logstart =0 ;
fs/freevxfs/vxfs_inode.c +0 -1
@@ -239,7 +239,6 @@ ip->i_ctime.tv_nsec =0 ; ip->i_mtime.tv_nsec =0 ; - ip->i_blksize =PAGE_SIZE ; ip->i_blocks = vip->vii_blocks; ip->i_generation = vip->vii_gen;
fs/fuse/inode.c +0 -1
@@ -118,7 +118,6 @@ inode->i_uid = attr->uid; inode->i_gid = attr->gid;i_size_write (inode, attr->size); - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks = attr->blocks; inode->i_atime.tv_sec = attr->atime; inode->i_atime.tv_nsec = attr->atimensec;
fs/hfs/inode.c +0 -2
@@ -154,7 +154,6 @@ inode->i_gid = current->fsgid; inode->i_nlink =1 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; - inode->i_blksize =HFS_SB (sb)->alloc_blksz;HFS_I (inode)->flags =0 ;HFS_I (inode)->rsrc_inode =NULL ;HFS_I (inode)->fs_blocks =0 ;
@@ -284,7 +283,6 @@ inode->i_uid = hsb->s_uid; inode->i_gid = hsb->s_gid; inode->i_nlink =1 ; - inode->i_blksize =HFS_SB (inode->i_sb)->alloc_blksz;if (idata->key)HFS_I (inode)->cat_key = *idata->key;
fs/hfsplus/inode.c +0 -2
@@ -304,7 +304,6 @@ inode->i_gid = current->fsgid; inode->i_nlink =1 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; - inode->i_blksize =HFSPLUS_SB (sb).alloc_blksz;INIT_LIST_HEAD (&HFSPLUS_I (inode).open_dir_list);init_MUTEX (&HFSPLUS_I (inode).extents_lock);atomic_set (&HFSPLUS_I (inode).opencnt,0 );
@@ -407,7 +406,6 @@ type =hfs_bnode_read_u16 (fd->bnode, fd->entryoffset);HFSPLUS_I (inode).dev =0 ; - inode->i_blksize =HFSPLUS_SB (inode->i_sb).alloc_blksz;if (type ==HFSPLUS_FOLDER ) {struct hfsplus_cat_folder *folder = &entry.folder;
fs/hpfs/inode.c +0 -1
@@ -17,7 +17,6 @@ i->i_gid =hpfs_sb (sb)->sb_gid; i->i_mode =hpfs_sb (sb)->sb_mode; hpfs_inode->i_conv =hpfs_sb (sb)->sb_conv; - i->i_blksize =512 ; i->i_size =-1 ; i->i_blocks =-1 ;
fs/hppfs/hppfs_kern.c +0 -1
@@ -152,7 +152,6 @@ ino->i_mode = proc_ino->i_mode; ino->i_nlink = proc_ino->i_nlink; ino->i_size = proc_ino->i_size; - ino->i_blksize = proc_ino->i_blksize; ino->i_blocks = proc_ino->i_blocks; }
fs/isofs/inode.c +1 -2
@@ -1238,7 +1238,7 @@ } inode->i_uid = sbi->s_uid; inode->i_gid = sbi->s_gid; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ; ei->i_format_parm[0 ] =0 ; ei->i_format_parm[1 ] =0 ;
@@ -1294,7 +1294,6 @@ isonum_711 (de->ext_attr_length));/* Set the number of blocks for stat() - should be done before RR */ - inode->i_blksize =PAGE_CACHE_SIZE ;/* For stat() only */ inode->i_blocks = (inode->i_size +511 ) >>9 ;/*
fs/jffs/inode-v23.c +0 -2
@@ -364,7 +364,6 @@ inode->i_ctime.tv_nsec =0 ; inode->i_mtime.tv_nsec =0 ; inode->i_atime.tv_nsec =0 ; - inode->i_blksize =PAGE_SIZE ; inode->i_blocks = (inode->i_size +511 ) >>9 ; f =jffs_find_file (c, raw_inode->ino);
@@ -1706,7 +1705,6 @@ inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec =0 ; - inode->i_blksize =PAGE_SIZE ; inode->i_blocks = (inode->i_size +511 ) >>9 ;if (S_ISREG (inode->i_mode)) { inode->i_op = &jffs_file_inode_operations;
fs/jffs2/fs.c +0 -2
@@ -263,7 +263,6 @@ inode->i_nlink = f->inocache->nlink; - inode->i_blksize =PAGE_SIZE ; inode->i_blocks = (inode->i_size +511 ) >>9 ;switch (inode->i_mode &S_IFMT ) {
@@ -449,7 +448,6 @@ inode->i_atime = inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; ri->atime = ri->mtime = ri->ctime =cpu_to_je32 (I_SEC (inode->i_mtime)); - inode->i_blksize =PAGE_SIZE ; inode->i_blocks =0 ; inode->i_size =0 ;
fs/minix/bitmap.c +1 -1
@@ -254,7 +254,7 @@ inode->i_gid = (dir->i_mode &S_ISGID ) ? dir->i_gid : current->fsgid; inode->i_ino = j; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ;memset (&minix_i (inode)->u,0 ,sizeof (minix_i (inode)->u));insert_inode_hash (inode);mark_inode_dirty (inode);
fs/minix/inode.c +2 -2
@@ -392,7 +392,7 @@ inode->i_mtime.tv_nsec =0 ; inode->i_atime.tv_nsec =0 ; inode->i_ctime.tv_nsec =0 ; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ;for (i =0 ; i <9 ; i++) minix_inode->u.i1_data[i] = raw_inode->i_zone[i];minix_set_inode (inode,old_decode_dev (raw_inode->i_zone[0 ]));
@@ -425,7 +425,7 @@ inode->i_mtime.tv_nsec =0 ; inode->i_atime.tv_nsec =0 ; inode->i_ctime.tv_nsec =0 ; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ;for (i =0 ; i <10 ; i++) minix_inode->u.i2_data[i] = raw_inode->i_zone[i];minix_set_inode (inode,old_decode_dev (raw_inode->i_zone[0 ]));
fs/ntfs/inode.c +0 -4
@@ -556,8 +556,6 @@/* Setup the generic vfs inode parts now. */ -/* This is the optimal IO size (for stat), not the fs block size. */ - vi->i_blksize =PAGE_CACHE_SIZE ;/* * This is for checking whether an inode has changed w.r.t. a file so * that the file can be updated if necessary (compare with f_version).
@@ -1234,7 +1232,6 @@ base_ni =NTFS_I (base_vi);/* Just mirror the values from the base inode. */ - vi->i_blksize = base_vi->i_blksize; vi->i_version = base_vi->i_version; vi->i_uid = base_vi->i_uid; vi->i_gid = base_vi->i_gid;
@@ -1504,7 +1501,6 @@ ni =NTFS_I (vi); base_ni =NTFS_I (base_vi);/* Just mirror the values from the base inode. */ - vi->i_blksize = base_vi->i_blksize; vi->i_version = base_vi->i_version; vi->i_uid = base_vi->i_uid; vi->i_gid = base_vi->i_gid;
fs/ntfs/mft.c +0 -5
@@ -2638,11 +2638,6 @@ } vi->i_ino = bit;/* -* This is the optimal IO size (for stat), not the fs block -* size. -*/ - vi->i_blksize =PAGE_CACHE_SIZE ; -/* * This is for checking whether an inode has changed w.r.t. a * file so that the file can be updated if necessary (compare * with f_version).
fs/ocfs2/dlm/dlmfs.c +0 -2
@@ -335,7 +335,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;
@@ -362,7 +361,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;
fs/ocfs2/inode.c +0 -2
@@ -251,7 +251,6 @@ inode->i_mode =le16_to_cpu (fe->i_mode); inode->i_uid =le32_to_cpu (fe->i_uid); inode->i_gid =le32_to_cpu (fe->i_gid); - inode->i_blksize = (u32 )osb->s_clustersize;/* Fast symlinks will have i_size but no allocated clusters. */ if (S_ISLNK (inode->i_mode) && !fe->i_clusters)
@@ -1174,7 +1173,6 @@ inode->i_uid =le32_to_cpu (fe->i_uid); inode->i_gid =le32_to_cpu (fe->i_gid); inode->i_mode =le16_to_cpu (fe->i_mode); - inode->i_blksize = (u32 ) osb->s_clustersize;if (S_ISLNK (inode->i_mode) &&le32_to_cpu (fe->i_clusters) ==0 ) inode->i_blocks =0 ;else
fs/qnx4/inode.c +0 -1
@@ -497,7 +497,6 @@ inode->i_ctime.tv_sec =le32_to_cpu (raw_inode->di_ctime); inode->i_ctime.tv_nsec =0 ; inode->i_blocks =le32_to_cpu (raw_inode->di_first_xtnt.xtnt_size); - inode->i_blksize =QNX4_DIR_ENTRY_SIZE ;memcpy (qnx4_inode, raw_inode,QNX4_DIR_ENTRY_SIZE );if (S_ISREG (inode->i_mode)) {
fs/ramfs/inode.c +0 -1
@@ -58,7 +58,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->a_ops = &ramfs_aops; inode->i_mapping->backing_dev_info = &ramfs_backing_dev_info;
fs/reiserfs/inode.c +0 -4
@@ -17,8 +17,6 @@#include <linux/writeback.h> #include <linux/quotaops.h> -extern int reiserfs_default_io_size;/* default io size devuned in super.c */ -static int reiserfs_commit_write (struct file *f,struct page *page,unsigned from,unsigned to); static int reiserfs_prepare_write(struct file *f, struct page *page,
@@ -1130,7 +1128,6 @@ ih =PATH_PITEM_HEAD (path);copy_key (INODE_PKEY (inode), &(ih->ih_key)); - inode->i_blksize = reiserfs_default_io_size;INIT_LIST_HEAD (&(REISERFS_I (inode)->i_prealloc_list));REISERFS_I (inode)->i_flags =0 ;
@@ -1885,7 +1882,6 @@ }// these do not go to on-disk stat data inode->i_ino =le32_to_cpu (ih.ih_key.k_objectid); - inode->i_blksize = reiserfs_default_io_size;// store in in-core inode the key of stat data and version all // object items will have (directory items will have old offset
fs/sysfs/inode.c +0 -1
@@ -113,7 +113,6 @@ {struct inode * inode =new_inode (sysfs_sb);if (inode) { - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->a_ops = &sysfs_aops; inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
fs/sysv/ialloc.c +1 -1
@@ -170,7 +170,7 @@ inode->i_uid = current->fsuid; inode->i_ino =fs16_to_cpu (sbi, ino); inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ;memset (SYSV_I (inode)->i_data,0 ,sizeof (SYSV_I (inode)->i_data));SYSV_I (inode)->i_dir_start_lookup =0 ;insert_inode_hash (inode);
fs/sysv/inode.c +1 -1
@@ -201,7 +201,7 @@ inode->i_ctime.tv_nsec =0 ; inode->i_atime.tv_nsec =0 ; inode->i_mtime.tv_nsec =0 ; - inode->i_blocks = inode->i_blksize =0 ; + inode->i_blocks =0 ; si =SYSV_I (inode);for (block =0 ; block <10 +1 +1 +1 ; block++)
fs/udf/ialloc.c +0 -1
@@ -120,7 +120,6 @@UDF_I_LOCATION (inode).logicalBlockNum = block;UDF_I_LOCATION (inode).partitionReferenceNum =UDF_I_LOCATION (dir).partitionReferenceNum; inode->i_ino =udf_get_lb_pblock (sb,UDF_I_LOCATION (inode),0 ); - inode->i_blksize =PAGE_SIZE ; inode->i_blocks =0 ;UDF_I_LENEATTR (inode) =0 ;UDF_I_LENALLOC (inode) =0 ;
fs/udf/inode.c +0 -2
@@ -916,8 +916,6 @@* i_nlink = 1 * i_op = NULL; */ - inode->i_blksize =PAGE_SIZE ; - bh =udf_read_ptagged (inode->i_sb,UDF_I_LOCATION (inode),0 , &ident);if (!bh)
fs/ufs/ialloc.c +0 -1
@@ -255,7 +255,6 @@ inode->i_gid = current->fsgid; inode->i_ino = cg * uspi->s_ipg + bit; - inode->i_blksize =PAGE_SIZE ;/* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks =0 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; ufsi->i_flags =UFS_I (dir)->i_flags;
include/linux/nfsd/nfsfh.h +2 -8
@@ -269,14 +269,8 @@ fhp->fh_post_uid = inode->i_uid; fhp->fh_post_gid = inode->i_gid; fhp->fh_post_size = inode->i_size; -if (inode->i_blksize) { - fhp->fh_post_blksize = inode->i_blksize; - fhp->fh_post_blocks = inode->i_blocks; - }else { - fhp->fh_post_blksize =BLOCK_SIZE ; -/* how much do we care for accuracy with MinixFS? */ - fhp->fh_post_blocks = (inode->i_size+511 ) >>9 ; - } + fhp->fh_post_blksize =BLOCK_SIZE ; + fhp->fh_post_blocks = inode->i_blocks; fhp->fh_post_rdev[0 ] =htonl ((u32 )imajor (inode)); fhp->fh_post_rdev[1 ] =htonl ((u32 )iminor (inode)); fhp->fh_post_atime = inode->i_atime;
ipc/mqueue.c +0 -1
@@ -115,7 +115,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mtime = inode->i_ctime = inode->i_atime =CURRENT_TIME ;
kernel/cpuset.c +0 -1
@@ -289,7 +289,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; inode->i_mapping->backing_dev_info = &cpuset_backing_dev_info;
mm/shmem.c +0 -1
@@ -1350,7 +1350,6 @@ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->a_ops = &shmem_aops; inode->i_mapping->backing_dev_info = &shmem_backing_dev_info;
net/sunrpc/rpc_pipe.c +0 -1
@@ -490,7 +490,6 @@return NULL ; inode->i_mode = mode; inode->i_uid = inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;switch (mode &S_IFMT ) {
security/inode.c +0 -1
@@ -64,7 +64,6 @@ inode->i_mode = mode; inode->i_uid =0 ; inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ;switch (mode &S_IFMT ) {
security/selinux/selinuxfs.c +0 -1
@@ -771,7 +771,6 @@if (ret) { ret->i_mode = mode; ret->i_uid = ret->i_gid =0 ; - ret->i_blksize =PAGE_CACHE_SIZE ; ret->i_blocks =0 ; ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ; }
fs/cifs/cifsfs.c +0 -1
@@ -255,7 +255,6 @@file data or metadata */ cifs_inode->clientCanCacheRead = FALSE; cifs_inode->clientCanCacheAll = FALSE; - cifs_inode->vfs_inode.i_blksize =CIFS_MAX_MSGSIZE ; cifs_inode->vfs_inode.i_blkbits =14 ;/* 2**14 = CIFS_MAX_MSGSIZE */ cifs_inode->vfs_inode.i_flags =S_NOATIME |S_NOCMTIME ;INIT_LIST_HEAD (&cifs_inode->openFileList);
fs/cifs/readdir.c +2 -3
@@ -219,10 +219,9 @@if (allocation_size < end_of_file)cFYI (1 , ("May be sparse file, allocation less than file size" )); -cFYI (1 , ("File Size %ld and blocks %llu and blocksize %ld" , +cFYI (1 , ("File Size %ld and blocks %llu" , (unsigned long )tmp_inode->i_size, - (unsigned long long )tmp_inode->i_blocks, - tmp_inode->i_blksize)); + (unsigned long long )tmp_inode->i_blocks));if (S_ISREG (tmp_inode->i_mode)) {cFYI (1 , ("File inode" )); tmp_inode->i_op = &cifs_file_inode_ops;
fs/hugetlbfs/inode.c +0 -1
@@ -359,7 +359,6 @@ inode->i_mode = mode; inode->i_uid = uid; inode->i_gid = gid; - inode->i_blksize =HPAGE_SIZE ; inode->i_blocks =0 ; inode->i_mapping->a_ops = &hugetlbfs_aops; inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info;
fs/jfs/jfs_extent.c +1 -1
@@ -468,7 +468,7 @@int extFill (struct inode *ip,xad_t * xp) {int rc, nbperpage =JFS_SBI (ip->i_sb)->nbperpage; -s64 blkno =offsetXAD (xp) >> ip->i_blksize; +s64 blkno =offsetXAD (xp) >> ip->i_blkbits;// assert(ISSPARSE(ip));
fs/jfs/jfs_imap.c +0 -1
@@ -3115,7 +3115,6 @@ ip->i_mtime.tv_nsec =le32_to_cpu (dip->di_mtime.tv_nsec); ip->i_ctime.tv_sec =le32_to_cpu (dip->di_ctime.tv_sec); ip->i_ctime.tv_nsec =le32_to_cpu (dip->di_ctime.tv_nsec); - ip->i_blksize = ip->i_sb->s_blocksize; ip->i_blocks =LBLK2PBLK (ip->i_sb,le64_to_cpu (dip->di_nblocks)); ip->i_generation =le32_to_cpu (dip->di_gen);
fs/jfs/jfs_inode.c +0 -1
@@ -115,7 +115,6 @@ } jfs_inode->mode2 |= mode; - inode->i_blksize = sb->s_blocksize; inode->i_blocks =0 ; inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; jfs_inode->otime = inode->i_ctime.tv_sec;
fs/jfs/jfs_metapage.c +1 -1
@@ -257,7 +257,7 @@int rc =0 ;int xflag;s64 xaddr; -sector_t file_blocks = (inode->i_size + inode->i_blksize -1 ) >> +sector_t file_blocks = (inode->i_size + inode->i_sb->s_blocksize -1 ) >> inode->i_blkbits;if (lblock >= file_blocks)
fs/ncpfs/inode.c +0 -1
@@ -224,7 +224,6 @@ inode->i_nlink =1 ; inode->i_uid = server->m.uid; inode->i_gid = server->m.gid; - inode->i_blksize =NCP_BLOCK_SIZE ;ncp_update_dates (inode, &nwinfo->i);ncp_update_inode (inode, nwinfo);
drivers/block/loop.c +5 -2
@@ -662,7 +662,8 @@mapping_set_gfp_mask (old_file->f_mapping, lo->old_gfp_mask); lo->lo_backing_file = file; - lo->lo_blocksize = mapping->host->i_blksize; + lo->lo_blocksize =S_ISBLK (mapping->host->i_mode) ? + mapping->host->i_bdev->bd_block_size :PAGE_SIZE ; lo->old_gfp_mask =mapping_gfp_mask (mapping);mapping_set_gfp_mask (mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));complete (&p->wait);
@@ -800,7 +801,9 @@if (!(lo_flags &LO_FLAGS_USE_AOPS ) && !file->f_op->write) lo_flags |=LO_FLAGS_READ_ONLY ; - lo_blocksize = inode->i_blksize; + lo_blocksize =S_ISBLK (inode->i_mode) ? + inode->i_bdev->bd_block_size :PAGE_SIZE ; + error =0 ; }else { goto out_putf;
fs/coda/coda_linux.c +0 -2
@@ -110,8 +110,6 @@ inode->i_nlink = attr->va_nlink;if (attr->va_size !=-1 ) inode->i_size = attr->va_size; -if (attr->va_blocksize !=-1 ) - inode->i_blksize = attr->va_blocksize;if (attr->va_size !=-1 ) inode->i_blocks = (attr->va_size +511 ) >>9 ;if (attr->va_atime.tv_sec !=-1 )
fs/smbfs/inode.c +0 -2
@@ -167,7 +167,6 @@ fattr->f_mtime = inode->i_mtime; fattr->f_ctime = inode->i_ctime; fattr->f_atime = inode->i_atime; - fattr->f_blksize= inode->i_blksize; fattr->f_blocks = inode->i_blocks; fattr->attr =SMB_I (inode)->attr;
@@ -201,7 +200,6 @@ inode->i_uid = fattr->f_uid; inode->i_gid = fattr->f_gid; inode->i_ctime = fattr->f_ctime; - inode->i_blksize= fattr->f_blksize; inode->i_blocks = fattr->f_blocks; inode->i_size = fattr->f_size; inode->i_mtime = fattr->f_mtime;
fs/smbfs/proc.c +0 -1
@@ -1826,7 +1826,6 @@ fattr->f_nlink =1 ; fattr->f_uid = server->mnt->uid; fattr->f_gid = server->mnt->gid; - fattr->f_blksize =SMB_ST_BLKSIZE ; fattr->f_unix =0 ; }
include/linux/smb.h +0 -1
@@ -88,7 +88,6 @@struct timespec f_atime;struct timespec f_mtime;struct timespec f_ctime; -unsigned long f_blksize;unsigned long f_blocks;int f_unix; };
fs/hostfs/hostfs_kern.c +0 -1
@@ -156,7 +156,6 @@ ino->i_mode = i_mode; ino->i_nlink = i_nlink; ino->i_size = i_size; - ino->i_blksize = i_blksize; ino->i_blocks = i_blocks;return (0 ); }
fs/nfs/inode.c +0 -4
@@ -282,10 +282,8 @@* report the blocks in 512byte units */ inode->i_blocks =nfs_calc_block_size (fattr->du.nfs3.used); - inode->i_blksize = inode->i_sb->s_blocksize; }else { inode->i_blocks = fattr->du.nfs2.blocks; - inode->i_blksize = fattr->du.nfs2.blocksize; } nfsi->attrtimeo =NFS_MINATTRTIMEO (inode); nfsi->attrtimeo_timestamp = jiffies;
@@ -970,10 +968,8 @@* report the blocks in 512byte units */ inode->i_blocks =nfs_calc_block_size (fattr->du.nfs3.used); - inode->i_blksize = inode->i_sb->s_blocksize; }else { inode->i_blocks = fattr->du.nfs2.blocks; - inode->i_blksize = fattr->du.nfs2.blocksize; } if ((fattr->valid & NFS_ATTR_FATTR_V4) != 0 &&
fs/xfs/linux-2.6/xfs_super.c +0 -1
@@ -171,7 +171,6 @@break ; } - inode->i_blksize =xfs_preferred_iosize (mp); inode->i_generation = ip->i_d.di_gen;i_size_write (inode, ip->i_d.di_size); inode->i_blocks =
fs/xfs/linux-2.6/xfs_vnode.c +0 -1
@@ -122,7 +122,6 @@ inode->i_blocks = vap->va_nblocks; inode->i_mtime = vap->va_mtime; inode->i_ctime = vap->va_ctime; - inode->i_blksize = vap->va_blocksize;if (vap->va_xflags &XFS_XFLAG_IMMUTABLE ) inode->i_flags |=S_IMMUTABLE ;else
drivers/infiniband/hw/ipath/ipath_fs.c +0 -1
@@ -61,7 +61,6 @@ inode->i_mode = mode; inode->i_uid =0 ; inode->i_gid =0 ; - inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks =0 ; inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; inode->i_private = data;
arch/s390/hypfs/inode.c +0 -1
@@ -91,7 +91,6 @@ ret->i_mode = mode; ret->i_uid = hypfs_info->uid; ret->i_gid = hypfs_info->gid; - ret->i_blksize =PAGE_CACHE_SIZE ; ret->i_blocks =0 ; ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ;if (mode &S_IFDIR )
fs/ecryptfs/inode.c +0 -1
@@ -91,7 +91,6 @@ dest->i_atime = src->i_atime; dest->i_mtime = src->i_mtime; dest->i_ctime = src->i_ctime; - dest->i_blksize = src->i_blksize; dest->i_blkbits = src->i_blkbits; dest->i_flags = src->i_flags; }
fs/gfs2/inode.c +0 -1
@@ -69,7 +69,6 @@ inode->i_atime.tv_nsec =0 ; inode->i_mtime.tv_nsec =0 ; inode->i_ctime.tv_nsec =0 ; - inode->i_blksize =PAGE_SIZE ; inode->i_blocks = ip->i_di.di_blocks << (GFS2_SB (inode)->sd_sb.sb_bsize_shift -GFS2_BASIC_BLOCK_SHIFT );
fs/reiser4/plugin/item/static_stat.c +0 -1
@@ -169,7 +169,6 @@ } state->extmask = bigmask;/* common initialisations */ - inode->i_blksize =get_super_private (inode->i_sb)->optimal_io_size;if (len - (bit /16 *sizeof (d16)) >0 ) {/* alignment in save_len_static_sd() is taken into account -edward */
fs/ufs/inode.c +0 -1
@@ -734,7 +734,6 @@ufs1_read_inode (inode, ufs_inode +ufs_inotofsbo (inode->i_ino)); } - inode->i_blksize =PAGE_SIZE ;/*This is the optimal IO size (for stat)*/ inode->i_version++; ufsi->i_lastfrag = (inode->i_size + uspi->s_fsize -1 ) >> uspi->s_fshift;
--
PATCH 6/8 inode-diet: Move i_cindex from struct inode to struct file
In reply to Theodore Ts'oinode.i_cindex isn't initialized until the character device is opened anyway, and there are far more struct inodes in memory than there are struct file. So move the cindex field to file.f_cindex, and change the one(!) user of cindex to use file pointer, which is in fact simpler.
include/linux/fs.h +1 -1
@@ -528,7 +528,6 @@struct block_device *i_bdev;struct cdev *i_cdev; }; -int i_cindex;__u32 i_generation;
@@ -749,6 +748,7 @@spinlock_t f_ep_lock;#endif /* #ifdef CONFIG_EPOLL */ struct address_space *f_mapping; +int f_cindex; };extern spinlock_t files_lock;#define file_list_lock () spin_lock(&files_lock);
fs/char_dev.c +1 -1
@@ -288,7 +288,7 @@ p = inode->i_cdev;if (!p) { inode->i_cdev = p = new; - inode->i_cindex = idx; + filp->f_cindex = idx;list_add (&inode->i_devices, &p->list); new =NULL ; }else if (!cdev_get (p))
drivers/ieee1394/ieee1394_core.h +1 -1
@@ -212,7 +212,7 @@/* return the index (within a minor number block) of a file */ static inline unsigned char ieee1394_file_to_instance (struct file *file) { -return file->f_dentry->d_inode->i_cindex; +return file->f_cindex; }extern int hpsb_disable_irm;
--
Re: [patch 6/8] inode-diet: Move i_cindex from struct inode to struct file
Quoted 4 lines · Theodore Ts'o
inode.i_cindex isn't initialized until the character device is opened anyway, and there are far more struct inodes in memory than there are struct file. So move the cindex field to file.f_cindex, and change the one(!) user of cindex to use file pointer, which is in fact simpler.
I think you got a pretty clear NACK from Al on this one.
Re: [patch 6/8] inode-diet: Move i_cindex from struct inode to struct file
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Theodore Ts'o
inode.i_cindex isn't initialized until the character device is opened anyway, and there are far more struct inodes in memory than there are struct file. So move the cindex field to file.f_cindex, and change the one(!) user of cindex to use file pointer, which is in fact simpler.
I think you got a pretty clear NACK from Al on this one.
I explained my reasoning to him --- that inode.i_cindex isn't initialized until after the VFS-specific char-open is called, so you can never depend on index.i_cindex being valid except in char device driver's open method --- and that function gets passed a file pointer as well as an index pointer. So the clean up that Al wants to do can just as easily be done by having the device drivers use file->f_cindex instead of inode->i_cindex.
- Ted
PATCH 7/8 inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
In reply to Theodore Ts'oThe i_blocks and i_size fields are only used for regular files. So we move them into the union, along with i_rdev and i_devices, which are only used by block or character devices.
include/linux/fs.h +12 -6
@@ -501,15 +501,12 @@unsigned int i_nlink;uid_t i_uid;gid_t i_gid; -dev_t i_rdev;loff_t i_size;struct timespec i_atime;struct timespec i_mtime;struct timespec i_ctime;unsigned int i_blkbits;unsigned long i_version; -blkcnt_t i_blocks; -unsigned short i_bytes;spinlock_t i_lock;/* i_blocks, i_bytes, maybe i_size */ struct mutex i_mutex;struct rw_semaphore i_alloc_sem;
@@ -522,11 +519,20 @@#ifdef CONFIG_QUOTA struct dquot *i_dquot[MAXQUOTAS ];#endif -struct list_head i_devices;union {struct pipe_inode_info *i_pipe; -struct block_device *i_bdev; -struct cdev *i_cdev; +struct { +union { +struct block_device *i_bdev; +struct cdev *i_cdev; + }; +dev_t i_rdev; +struct list_head i_devices; + }; +struct { +unsigned short i_bytes; +blkcnt_t i_blocks; + }; };__u32 i_generation;
fs/stat.c +1 -1
@@ -32,7 +32,7 @@ stat->mtime = inode->i_mtime; stat->ctime = inode->i_ctime; stat->size =i_size_read (inode); - stat->blocks = inode->i_blocks; + stat->blocks =S_ISREG (inode->i_mode) ? inode->i_blocks :0 ; stat->blksize =PAGE_CACHE_SIZE ; }
--
Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
Quoted 3 lines · On Sun, 02 Jul 2006 20:53:40 -0400 "Theodore Ts'o" <[email protected]> wrote:
The
i_blocksandi_sizefields are only used for regular files. So we move them into the union, along withi_rdevandi_devices, which are only used by block or character devices.
It appears that device nodes in tmpfs tripped this up.
audit(1151888221.911:3): policy loaded auid=4294967295
SELinux: initialized (dev usbfs, type usbfs), uses genfs_contexts
audit(1151913428.996:4): avc: denied { audit_write } for pid=396 comm="hwclock" capability=29 scontext=system_u:system_r:hwclock_t:s0 tcontext=system_u:system_r:hwclock_t:s0 tclass=capability
------------[ cut here ]------------ kernel BUG at mm/shmem.c:693! invalid opcode: 0000 [#1] 4K_STACKS last sysfs file: /block/ram0/removable Modules linked in: generic ext3 jbd ide_disk ide_core CPU: 0 EIP: 0060:[<c0151d59>] Not tainted VLI EFLAGS: 00010202 (2.6.17-mm6 #3)
EIP is at shmem_delete_inode+0x89/0xa4
eax: c04408e0 ebx: f7c5915c ecx: f7c59300 edx: c0384ae0
esi: f7c5915c edi: f7f25540 ebp: f7cafd14 esp: f7f0cec8
ds: 007b es: 007b ss: 0068
Process MAKEDEV (pid: 417, ti=f7f0c000 task=c1d13aa0 task.ti=f7f0c000)
Stack: f7c5915c c0151cd0 f7caa694 c01695c9 f7c5915c f7c70f14 c01690af f7c70f14
c01684ba 00000000 f7c70f14 c0162180 f7c70f14 c1c59000 c1c56000 00000000
f7cafd14 f7cafd14 f7ff2c40 01c9c1ec 00000004 c1c56005 00000010 00000000
Call Trace:
[<c0151cd0>] shmem_delete_inode+0x0/0xa4
[<c01695c9>] generic_delete_inode+0x9d/0xf5
[<c01690af>] iput+0x64/0x66
[<c01684ba>] dput+0xfb/0x113
[<c0162180>] sys_renameat+0x163/0x1b4
[<c0168405>] dput+0x46/0x113
[<c01621f8>] sys_rename+0x27/0x2b
[<c0102ac5>] sysenter_past_esp+0x56/0x79
Code: 3c 00 00 00 00 e8 bb e1 ff ff 8b 56 f8 8d 4e f8 39 ca 74 0e 8b 41 04 89 42 04 89 10 89 49 04 89 4e f8 83 be e8 00 00 00 00 74 08 <0f> 0b b5 02 56 72 2e c0 83 7f 08 00 74 03 ff 47 0c 5b 89 f0 5e
EIP: [<c0151d59>] shmem_delete_inode+0x89/0xa4 SS:ESP 0068:f7f0cec8Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
Quoted 10 lines · Andrew Morton
Quoted 3 lines · On Sun, 02 Jul 2006 20:53:40 -0400 "Theodore Ts'o" <[email protected]> wrote:
The
i_blocksandi_sizefields are only used for regular files. So we move them into the union, along withi_rdevandi_devices, which are only used by block or character devices.It appears that device nodes in tmpfs tripped this up. kernel BUG at
mm/shmem.c:693!
EIP is atshmem_delete_inode+0x89/0xa4
I'm happy for you to resolve that by moving the tmpfs BUG_ON up into the truncation block just above it, patch below. But note that this also covers the case of long symbolic links, and I think tmpfs is not alone in using i_blocks with long symbolic links; and would some file- systems also use it with directories? Looks to me like there's more auditing needed before putting i_blocks into a union (and it might help if we delete those many lines initializing i_blocks to 0:
they're probably done before the union diverges, but worrysome).
Hugh
mm/shmem.c +1 -1
@@ -689,8 +689,8 @@ static void shmem_delete_inode(struct inlist_del_init (&info->swaplist);spin_unlock (&shmem_swaplist_lock); } +BUG_ON (inode->i_blocks); } -BUG_ON (inode->i_blocks);if (sbinfo->max_inodes) {spin_lock (&sbinfo->stat_lock); sbinfo->free_inodes++;
Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
In reply to Theodore Ts'oQuoted 3 lines · Theodore Ts'o
The
i_blocksandi_sizefields are only used for regular files. So we move them into the union, along withi_rdevandi_devices, which are only used by block or character devices.
Can we please make this a named instead of unnamed union so everyone still using the fields will trip up? To reduce the impact a few more imajor/iminor conversions might be needed were direct references to i_rdev crept back in.
Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
Quoted 8 lines · Christoph Hellwig
Quoted 3 lines · Theodore Ts'o
The
i_blocksandi_sizefields are only used for regular files. So we move them into the union, along withi_rdevandi_devices, which are only used by block or character devices.Can we please make this a named instead of unnamed union so everyone still using the fields will trip up? To reduce the impact a few more imajor/iminor conversions might be needed were direct references to
i_rdevcrept back in.
I did that originally but when I sent out my first version of patches for review, other developers asked me to use an unnamed union --- since otherwise the patch would be much, much larger (lots of changes would need to be made) and that makes it much harder to merge into either Andrew's or Linus's tree.
What do other people think? I can go either way on this one.
- Ted
Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
The
i_blocksandi_sizefields are only used for regular files. So we move them into the union, along withi_rdevandi_devices, which are only used by block or character devices.Can we please make this a named instead of unnamed union so everyone still using the fields will trip up? To reduce the impact a few more imajor/iminor conversions might be needed were direct references to
i_rdevcrept back in.
Quoted 7 lines
I did that originally but when I sent out my first version of patches for review, other developers asked me to use an unnamed union --- since otherwise the patch would be much, much larger (lots of changes would need to be made) and that makes it much harder to merge into either Andrew's or Linus's tree.
What do other people think? I can go either way on this one.
I prefer unnamed. A dislike it when unions make initializers longer than necessary, even if it's short.
inode->u.file.a.i_blksize...
vs
inode->i_blksize
Jan Engelhardt
Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
In reply to Theodore TsoQuoted 9 lines · Theodore Tso
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines · Theodore Ts'o
The
i_blocksandi_sizefields are only used for regular files. So we move them into the union, along withi_rdevandi_devices, which are only used by block or character devices.Can we please make this a named instead of unnamed union so everyone still using the fields will trip up? To reduce the impact a few more imajor/iminor conversions might be needed were direct references to
i_rdevcrept back in.
Quoted 8 lines
I did that originally but when I sent out my first version of patches for review, other developers asked me to use an unnamed union --- since otherwise the patch would be much, much larger (lots of changes would need to be made) and that makes it much harder to merge into either Andrew's or Linus's tree.
What do other people think? I can go either way on this one.
I think people need to know they're using a union, and hence it should be named. Otherwise it's really easy to stare blindly at a piece of code, not understanding why touching i_foo affects i_bar.
-hpa
PATCH 8/8 inode-diet: Fix size of i_blkbits, i_version, and i_dnotify_mask
In reply to Theodore Ts'oi_blkbits stores the log n of the blocksize; there is no reason for it to take more than 16 bits, so change it to be a short and put it next to i_mode.
i_version and i_dnotify_mask need to be 32 bits, but there is no reason for them to be 64-bit values on 64-bit architectures, so make them be unsigned int's instead of unsigned long's.
include/linux/fs.h +3 -3
@@ -498,6 +498,7 @@unsigned long i_ino;atomic_t i_count;umode_t i_mode; +unsigned short i_blkbits;unsigned int i_nlink;uid_t i_uid;gid_t i_gid;
@@ -505,8 +506,7 @@struct timespec i_atime;struct timespec i_mtime;struct timespec i_ctime; -unsigned int i_blkbits; -unsigned long i_version; +unsigned int i_version;spinlock_t i_lock;/* i_blocks, i_bytes, maybe i_size */ struct mutex i_mutex;struct rw_semaphore i_alloc_sem;
@@ -538,7 +538,7 @@__u32 i_generation;#ifdef CONFIG_DNOTIFY -unsigned long i_dnotify_mask;/* Directory notify events */ +unsigned int i_dnotify_mask;/* Directory notify events */ struct dnotify_struct *i_dnotify;/* for directory notifications */ #endif
--