diff options
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 0e87401cf335..9196f2a270da 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/sched/signal.h> | ||
22 | #include <linux/syscalls.h> | 23 | #include <linux/syscalls.h> |
23 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
24 | #include <linux/iomap.h> | 25 | #include <linux/iomap.h> |
@@ -2395,7 +2396,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping, | |||
2395 | loff_t pos, loff_t *bytes) | 2396 | loff_t pos, loff_t *bytes) |
2396 | { | 2397 | { |
2397 | struct inode *inode = mapping->host; | 2398 | struct inode *inode = mapping->host; |
2398 | unsigned blocksize = 1 << inode->i_blkbits; | 2399 | unsigned int blocksize = i_blocksize(inode); |
2399 | struct page *page; | 2400 | struct page *page; |
2400 | void *fsdata; | 2401 | void *fsdata; |
2401 | pgoff_t index, curidx; | 2402 | pgoff_t index, curidx; |
@@ -2475,8 +2476,8 @@ int cont_write_begin(struct file *file, struct address_space *mapping, | |||
2475 | get_block_t *get_block, loff_t *bytes) | 2476 | get_block_t *get_block, loff_t *bytes) |
2476 | { | 2477 | { |
2477 | struct inode *inode = mapping->host; | 2478 | struct inode *inode = mapping->host; |
2478 | unsigned blocksize = 1 << inode->i_blkbits; | 2479 | unsigned int blocksize = i_blocksize(inode); |
2479 | unsigned zerofrom; | 2480 | unsigned int zerofrom; |
2480 | int err; | 2481 | int err; |
2481 | 2482 | ||
2482 | err = cont_expand_zero(file, mapping, pos, bytes); | 2483 | err = cont_expand_zero(file, mapping, pos, bytes); |
@@ -2838,7 +2839,7 @@ int nobh_truncate_page(struct address_space *mapping, | |||
2838 | struct buffer_head map_bh; | 2839 | struct buffer_head map_bh; |
2839 | int err; | 2840 | int err; |
2840 | 2841 | ||
2841 | blocksize = 1 << inode->i_blkbits; | 2842 | blocksize = i_blocksize(inode); |
2842 | length = offset & (blocksize - 1); | 2843 | length = offset & (blocksize - 1); |
2843 | 2844 | ||
2844 | /* Block boundary? Nothing to do */ | 2845 | /* Block boundary? Nothing to do */ |
@@ -2916,7 +2917,7 @@ int block_truncate_page(struct address_space *mapping, | |||
2916 | struct buffer_head *bh; | 2917 | struct buffer_head *bh; |
2917 | int err; | 2918 | int err; |
2918 | 2919 | ||
2919 | blocksize = 1 << inode->i_blkbits; | 2920 | blocksize = i_blocksize(inode); |
2920 | length = offset & (blocksize - 1); | 2921 | length = offset & (blocksize - 1); |
2921 | 2922 | ||
2922 | /* Block boundary? Nothing to do */ | 2923 | /* Block boundary? Nothing to do */ |
@@ -3028,7 +3029,7 @@ sector_t generic_block_bmap(struct address_space *mapping, sector_t block, | |||
3028 | struct inode *inode = mapping->host; | 3029 | struct inode *inode = mapping->host; |
3029 | tmp.b_state = 0; | 3030 | tmp.b_state = 0; |
3030 | tmp.b_blocknr = 0; | 3031 | tmp.b_blocknr = 0; |
3031 | tmp.b_size = 1 << inode->i_blkbits; | 3032 | tmp.b_size = i_blocksize(inode); |
3032 | get_block(inode, block, &tmp, 0); | 3033 | get_block(inode, block, &tmp, 0); |
3033 | return tmp.b_blocknr; | 3034 | return tmp.b_blocknr; |
3034 | } | 3035 | } |