Skip to content

Commit 43237b5

Browse files
committed
ext3: Get rid of extenddisksize parameter of ext3_get_blocks_handle()
Get rid of extenddisksize parameter of ext3_get_blocks_handle(). This seems to be a relict from some old days and setting disksize in this function does not make much sence. Currently it was set only by ext3_getblk(). Since the parameter has some effect only if create == 1, it is easy to check that the three callers which end up calling ext3_getblk() with create == 1 (ext3_append, ext3_quota_write, ext3_mkdir) do the right thing and set disksize themselves. Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 1e9fd53 commit 43237b5

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

‎fs/ext3/dir.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ static int ext3_readdir(struct file * filp,
130130
struct buffer_head *bh = NULL;
131131

132132
map_bh.b_state = 0;
133-
err = ext3_get_blocks_handle(NULL, inode, blk, 1,
134-
&map_bh, 0, 0);
133+
err = ext3_get_blocks_handle(NULL, inode, blk, 1, &map_bh, 0);
135134
if (err > 0) {
136135
pgoff_t index = map_bh.b_blocknr >>
137136
(PAGE_CACHE_SHIFT - inode->i_blkbits);

‎fs/ext3/inode.c‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
788788
int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
789789
sector_t iblock, unsigned long maxblocks,
790790
struct buffer_head *bh_result,
791-
int create, int extend_disksize)
791+
int create)
792792
{
793793
int err = -EIO;
794794
int offsets[4];
@@ -911,13 +911,6 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
911911
if (!err)
912912
err = ext3_splice_branch(handle, inode, iblock,
913913
partial, indirect_blks, count);
914-
/*
915-
* i_disksize growing is protected by truncate_mutex. Don't forget to
916-
* protect it if you're about to implement concurrent
917-
* ext3_get_block() -bzzz
918-
*/
919-
if (!err && extend_disksize && inode->i_size > ei->i_disksize)
920-
ei->i_disksize = inode->i_size;
921914
mutex_unlock(&ei->truncate_mutex);
922915
if (err)
923916
goto cleanup;
@@ -972,7 +965,7 @@ static int ext3_get_block(struct inode *inode, sector_t iblock,
972965
}
973966

974967
ret = ext3_get_blocks_handle(handle, inode, iblock,
975-
max_blocks, bh_result, create, 0);
968+
max_blocks, bh_result, create);
976969
if (ret > 0) {
977970
bh_result->b_size = (ret << inode->i_blkbits);
978971
ret = 0;
@@ -1005,7 +998,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
1005998
dummy.b_blocknr = -1000;
1006999
buffer_trace_init(&dummy.b_history);
10071000
err = ext3_get_blocks_handle(handle, inode, block, 1,
1008-
&dummy, create, 1);
1001+
&dummy, create);
10091002
/*
10101003
* ext3_get_blocks_handle() returns number of blocks
10111004
* mapped. 0 in case of a HOLE.

‎include/linux/ext3_fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
874874
struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
875875
int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
876876
sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
877-
int create, int extend_disksize);
877+
int create);
878878

879879
extern struct inode *ext3_iget(struct super_block *, unsigned long);
880880
extern int ext3_write_inode (struct inode *, int);

0 commit comments

Comments
 (0)