aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2006-09-27 04:50:49 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:26:18 -0400
commitba52de123d454b57369f291348266d86f4b35070 (patch)
tree3973f3f3c853b5857b6b64a027cadd4fe954e3b9 /drivers
parent577c4eb09d1034d0739e3135fd2cff50588024be (diff)
[PATCH] inode-diet: Eliminate i_blksize from the inode structure
This 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. [bunk@stusta.de: cleanup] [akpm@osdl.org: generic_fillattr() fix] Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/loop.c7
-rw-r--r--drivers/infiniband/hw/ipath/ipath_fs.c1
-rw-r--r--drivers/isdn/capi/capifs.c2
-rw-r--r--drivers/misc/ibmasm/ibmasmfs.c1
-rw-r--r--drivers/oprofile/oprofilefs.c1
-rw-r--r--drivers/usb/core/inode.c1
-rw-r--r--drivers/usb/gadget/inode.c1
7 files changed, 5 insertions, 9 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 7b3b94ddddcc..c774121684d7 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -662,7 +662,8 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
662 662
663 mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask); 663 mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
664 lo->lo_backing_file = file; 664 lo->lo_backing_file = file;
665 lo->lo_blocksize = mapping->host->i_blksize; 665 lo->lo_blocksize = S_ISBLK(mapping->host->i_mode) ?
666 mapping->host->i_bdev->bd_block_size : PAGE_SIZE;
666 lo->old_gfp_mask = mapping_gfp_mask(mapping); 667 lo->old_gfp_mask = mapping_gfp_mask(mapping);
667 mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS)); 668 mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
668 complete(&p->wait); 669 complete(&p->wait);
@@ -794,7 +795,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
794 if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write) 795 if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write)
795 lo_flags |= LO_FLAGS_READ_ONLY; 796 lo_flags |= LO_FLAGS_READ_ONLY;
796 797
797 lo_blocksize = inode->i_blksize; 798 lo_blocksize = S_ISBLK(inode->i_mode) ?
799 inode->i_bdev->bd_block_size : PAGE_SIZE;
800
798 error = 0; 801 error = 0;
799 } else { 802 } else {
800 goto out_putf; 803 goto out_putf;
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index 055cdd089b28..c8a8af0fe471 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -61,7 +61,6 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
61 inode->i_mode = mode; 61 inode->i_mode = mode;
62 inode->i_uid = 0; 62 inode->i_uid = 0;
63 inode->i_gid = 0; 63 inode->i_gid = 0;
64 inode->i_blksize = PAGE_CACHE_SIZE;
65 inode->i_blocks = 0; 64 inode->i_blocks = 0;
66 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 65 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
67 inode->i_private = data; 66 inode->i_private = data;
diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c
index 9ea6bd0ddc35..2dd1b57b0ba4 100644
--- a/drivers/isdn/capi/capifs.c
+++ b/drivers/isdn/capi/capifs.c
@@ -104,7 +104,6 @@ capifs_fill_super(struct super_block *s, void *data, int silent)
104 inode->i_ino = 1; 104 inode->i_ino = 1;
105 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 105 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
106 inode->i_blocks = 0; 106 inode->i_blocks = 0;
107 inode->i_blksize = 1024;
108 inode->i_uid = inode->i_gid = 0; 107 inode->i_uid = inode->i_gid = 0;
109 inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; 108 inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
110 inode->i_op = &simple_dir_inode_operations; 109 inode->i_op = &simple_dir_inode_operations;
@@ -149,7 +148,6 @@ void capifs_new_ncci(unsigned int number, dev_t device)
149 if (!inode) 148 if (!inode)
150 return; 149 return;
151 inode->i_ino = number+2; 150 inode->i_ino = number+2;
152 inode->i_blksize = 1024;
153 inode->i_uid = config.setuid ? config.uid : current->fsuid; 151 inode->i_uid = config.setuid ? config.uid : current->fsuid;
154 inode->i_gid = config.setgid ? config.gid : current->fsgid; 152 inode->i_gid = config.setgid ? config.gid : current->fsgid;
155 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 153 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index 0e909b617226..b99dc507de2e 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -147,7 +147,6 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
147 if (ret) { 147 if (ret) {
148 ret->i_mode = mode; 148 ret->i_mode = mode;
149 ret->i_uid = ret->i_gid = 0; 149 ret->i_uid = ret->i_gid = 0;
150 ret->i_blksize = PAGE_CACHE_SIZE;
151 ret->i_blocks = 0; 150 ret->i_blocks = 0;
152 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 151 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
153 } 152 }
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index deb37354785b..5756401fb15b 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -31,7 +31,6 @@ static struct inode * oprofilefs_get_inode(struct super_block * sb, int mode)
31 inode->i_mode = mode; 31 inode->i_mode = mode;
32 inode->i_uid = 0; 32 inode->i_uid = 0;
33 inode->i_gid = 0; 33 inode->i_gid = 0;
34 inode->i_blksize = PAGE_CACHE_SIZE;
35 inode->i_blocks = 0; 34 inode->i_blocks = 0;
36 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 35 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
37 } 36 }
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 482f253085e5..58b4b1012120 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -249,7 +249,6 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de
249 inode->i_mode = mode; 249 inode->i_mode = mode;
250 inode->i_uid = current->fsuid; 250 inode->i_uid = current->fsuid;
251 inode->i_gid = current->fsgid; 251 inode->i_gid = current->fsgid;
252 inode->i_blksize = PAGE_CACHE_SIZE;
253 inode->i_blocks = 0; 252 inode->i_blocks = 0;
254 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 253 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
255 switch (mode & S_IFMT) { 254 switch (mode & S_IFMT) {
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index ffaa8c1afad8..2a7162d89799 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1966,7 +1966,6 @@ gadgetfs_make_inode (struct super_block *sb,
1966 inode->i_mode = mode; 1966 inode->i_mode = mode;
1967 inode->i_uid = default_uid; 1967 inode->i_uid = default_uid;
1968 inode->i_gid = default_gid; 1968 inode->i_gid = default_gid;
1969 inode->i_blksize = PAGE_CACHE_SIZE;
1970 inode->i_blocks = 0; 1969 inode->i_blocks = 0;
1971 inode->i_atime = inode->i_mtime = inode->i_ctime 1970 inode->i_atime = inode->i_mtime = inode->i_ctime
1972 = CURRENT_TIME; 1971 = CURRENT_TIME;