diff options
author | Theodore Ts'o <tytso@mit.edu> | 2006-09-27 04:50:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:18 -0400 |
commit | ba52de123d454b57369f291348266d86f4b35070 (patch) | |
tree | 3973f3f3c853b5857b6b64a027cadd4fe954e3b9 /drivers/block/loop.c | |
parent | 577c4eb09d1034d0739e3135fd2cff50588024be (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/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 7 |
1 files changed, 5 insertions, 2 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; |