diff options
author | Jan Kara <jack@suse.cz> | 2017-08-24 11:52:21 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-08-24 11:52:21 -0400 |
commit | 4f9d956d1939f97e2cb278b9615b6c683cd90e97 (patch) | |
tree | b5dcabfa8a15252ab29d6a3bbac7040ea8ddb7df /fs/ext4 | |
parent | 32aaf194201e98db4235b7b71ac62a22e2ac355f (diff) | |
download | linux-4f9d956d1939f97e2cb278b9615b6c683cd90e97.tar.gz linux-4f9d956d1939f97e2cb278b9615b6c683cd90e97.tar.bz2 linux-4f9d956d1939f97e2cb278b9615b6c683cd90e97.zip |
ext4: do not unnecessarily allocate buffer in recently_deleted()
In recently_deleted() function we want to check whether inode is still
cached in buffer cache. Use sb_find_get_block() for that instead of
sb_getblk() to avoid unnecessary allocation of bdev page and buffer
heads.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/ialloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 507bfb3344d4..0d03e73dccaf 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -707,9 +707,9 @@ static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino) if (unlikely(!gdp)) return 0; - bh = sb_getblk(sb, ext4_inode_table(sb, gdp) + + bh = sb_find_get_block(sb, ext4_inode_table(sb, gdp) + (ino / inodes_per_block)); - if (unlikely(!bh) || !buffer_uptodate(bh)) + if (!bh || !buffer_uptodate(bh)) /* * If the block is not in the buffer cache, then it * must have been written out. |