mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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>
This commit is contained in:
parent
1e9fd53b78
commit
43237b5490
3 changed files with 5 additions and 13 deletions
|
@ -130,8 +130,7 @@ static int ext3_readdir(struct file * filp,
|
||||||
struct buffer_head *bh = NULL;
|
struct buffer_head *bh = NULL;
|
||||||
|
|
||||||
map_bh.b_state = 0;
|
map_bh.b_state = 0;
|
||||||
err = ext3_get_blocks_handle(NULL, inode, blk, 1,
|
err = ext3_get_blocks_handle(NULL, inode, blk, 1, &map_bh, 0);
|
||||||
&map_bh, 0, 0);
|
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
pgoff_t index = map_bh.b_blocknr >>
|
pgoff_t index = map_bh.b_blocknr >>
|
||||||
(PAGE_CACHE_SHIFT - inode->i_blkbits);
|
(PAGE_CACHE_SHIFT - inode->i_blkbits);
|
||||||
|
|
|
@ -788,7 +788,7 @@ err_out:
|
||||||
int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
|
int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
|
||||||
sector_t iblock, unsigned long maxblocks,
|
sector_t iblock, unsigned long maxblocks,
|
||||||
struct buffer_head *bh_result,
|
struct buffer_head *bh_result,
|
||||||
int create, int extend_disksize)
|
int create)
|
||||||
{
|
{
|
||||||
int err = -EIO;
|
int err = -EIO;
|
||||||
int offsets[4];
|
int offsets[4];
|
||||||
|
@ -911,13 +911,6 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
|
||||||
if (!err)
|
if (!err)
|
||||||
err = ext3_splice_branch(handle, inode, iblock,
|
err = ext3_splice_branch(handle, inode, iblock,
|
||||||
partial, indirect_blks, count);
|
partial, indirect_blks, count);
|
||||||
/*
|
|
||||||
* i_disksize growing is protected by truncate_mutex. Don't forget to
|
|
||||||
* protect it if you're about to implement concurrent
|
|
||||||
* ext3_get_block() -bzzz
|
|
||||||
*/
|
|
||||||
if (!err && extend_disksize && inode->i_size > ei->i_disksize)
|
|
||||||
ei->i_disksize = inode->i_size;
|
|
||||||
mutex_unlock(&ei->truncate_mutex);
|
mutex_unlock(&ei->truncate_mutex);
|
||||||
if (err)
|
if (err)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -972,7 +965,7 @@ static int ext3_get_block(struct inode *inode, sector_t iblock,
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ext3_get_blocks_handle(handle, inode, iblock,
|
ret = ext3_get_blocks_handle(handle, inode, iblock,
|
||||||
max_blocks, bh_result, create, 0);
|
max_blocks, bh_result, create);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
bh_result->b_size = (ret << inode->i_blkbits);
|
bh_result->b_size = (ret << inode->i_blkbits);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -1005,7 +998,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
|
||||||
dummy.b_blocknr = -1000;
|
dummy.b_blocknr = -1000;
|
||||||
buffer_trace_init(&dummy.b_history);
|
buffer_trace_init(&dummy.b_history);
|
||||||
err = ext3_get_blocks_handle(handle, inode, block, 1,
|
err = ext3_get_blocks_handle(handle, inode, block, 1,
|
||||||
&dummy, create, 1);
|
&dummy, create);
|
||||||
/*
|
/*
|
||||||
* ext3_get_blocks_handle() returns number of blocks
|
* ext3_get_blocks_handle() returns number of blocks
|
||||||
* mapped. 0 in case of a HOLE.
|
* mapped. 0 in case of a HOLE.
|
||||||
|
|
|
@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
|
||||||
struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
|
struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
|
||||||
int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
|
int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
|
||||||
sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
|
sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
|
||||||
int create, int extend_disksize);
|
int create);
|
||||||
|
|
||||||
extern struct inode *ext3_iget(struct super_block *, unsigned long);
|
extern struct inode *ext3_iget(struct super_block *, unsigned long);
|
||||||
extern int ext3_write_inode (struct inode *, int);
|
extern int ext3_write_inode (struct inode *, int);
|
||||||
|
|
Loading…
Reference in a new issue