aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-02-23 23:00:13 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-02-24 02:00:41 -0500
commit8b8343fa9d503894ece57acbe46cb36883646685 (patch)
treea8650f40e45644e91aad8298038aee3c024a80d8 /fs/f2fs/f2fs.h
parent8a7ed66aaf8ee56b0a6beee4d02e10af5a9e38b2 (diff)
f2fs: implement a lock-free stat_show
The stat_show is just to show the current status of f2fs. So, we can remove all the there-in locks. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 11fd8bec670b..4beedccc28a0 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -704,11 +704,7 @@ static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
704 704
705static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi) 705static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi)
706{ 706{
707 block_t ret; 707 return sbi->total_valid_block_count;
708 spin_lock(&sbi->stat_lock);
709 ret = sbi->total_valid_block_count;
710 spin_unlock(&sbi->stat_lock);
711 return ret;
712} 708}
713 709
714static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag) 710static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag)
@@ -804,11 +800,7 @@ static inline void dec_valid_node_count(struct f2fs_sb_info *sbi,
804 800
805static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi) 801static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
806{ 802{
807 unsigned int ret; 803 return sbi->total_valid_node_count;
808 spin_lock(&sbi->stat_lock);
809 ret = sbi->total_valid_node_count;
810 spin_unlock(&sbi->stat_lock);
811 return ret;
812} 804}
813 805
814static inline void inc_valid_inode_count(struct f2fs_sb_info *sbi) 806static inline void inc_valid_inode_count(struct f2fs_sb_info *sbi)
@@ -829,11 +821,7 @@ static inline void dec_valid_inode_count(struct f2fs_sb_info *sbi)
829 821
830static inline unsigned int valid_inode_count(struct f2fs_sb_info *sbi) 822static inline unsigned int valid_inode_count(struct f2fs_sb_info *sbi)
831{ 823{
832 unsigned int ret; 824 return sbi->total_valid_inode_count;
833 spin_lock(&sbi->stat_lock);
834 ret = sbi->total_valid_inode_count;
835 spin_unlock(&sbi->stat_lock);
836 return ret;
837} 825}
838 826
839static inline void f2fs_put_page(struct page *page, int unlock) 827static inline void f2fs_put_page(struct page *page, int unlock)