diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-02-20 05:15:15 +0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-02-20 05:15:15 +0400 |
commit | 9a6633b1a3603ccdffec669033616f9ebb35a988 (patch) | |
tree | 48f84c6ddaf415831eee8245033af51454859738 /fs/ext4/extents_status.h | |
parent | ce37c42919608e96ade3748fe23c3062a0a966c5 (diff) | |
download | linux-9a6633b1a3603ccdffec669033616f9ebb35a988.tar.xz |
ext4: add ext4_es_store_pblock_status()
Avoid false positives by static code analysis tools such as sparse and
coverity caused by the fact that we set the physical block, and then
the status in the extent_status structure. It is also more efficient
to set both of these values at once.
Addresses-Coverity-Id: #989077
Addresses-Coverity-Id: #989078
Addresses-Coverity-Id: #1080722
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Diffstat (limited to 'fs/ext4/extents_status.h')
-rw-r--r-- | fs/ext4/extents_status.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h index 167f4ab8ecc3..f1b62a419920 100644 --- a/fs/ext4/extents_status.h +++ b/fs/ext4/extents_status.h @@ -129,6 +129,15 @@ static inline void ext4_es_store_status(struct extent_status *es, (es->es_pblk & ~ES_MASK)); } +static inline void ext4_es_store_pblock_status(struct extent_status *es, + ext4_fsblk_t pb, + unsigned int status) +{ + es->es_pblk = (((ext4_fsblk_t) + (status & EXTENT_STATUS_FLAGS) << ES_SHIFT) | + (pb & ~ES_MASK)); +} + extern void ext4_es_register_shrinker(struct ext4_sb_info *sbi); extern void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi); extern void ext4_es_lru_add(struct inode *inode); |