diff options
author | piaojun <piaojun@huawei.com> | 2018-04-05 19:18:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-06 00:36:21 -0400 |
commit | 1119d3c06f64a7123d774c363440987952c522ef (patch) | |
tree | 3ea049b8e46a79428322185c1dd86e306d1022a8 | |
parent | 6870c0165feaa5e337e78ab2c781ed46f086bca2 (diff) |
ocfs2: use 'osb' instead of 'OCFS2_SB()'
We could use 'osb' instead of 'OCFS2_SB()' to make code more elegant.
Link: http://lkml.kernel.org/r/5A702111.7090907@huawei.com
Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <ge.changwei@h3c.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ocfs2/aops.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/dir.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/dlmglue.c | 21 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/inode.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/refcounttree.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/xattr.c | 2 |
9 files changed, 21 insertions, 26 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index e8e205bf2e41..5ff960b7f078 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -2213,7 +2213,7 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock, | |||
2213 | down_write(&oi->ip_alloc_sem); | 2213 | down_write(&oi->ip_alloc_sem); |
2214 | 2214 | ||
2215 | if (first_get_block) { | 2215 | if (first_get_block) { |
2216 | if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) | 2216 | if (ocfs2_sparse_alloc(osb)) |
2217 | ret = ocfs2_zero_tail(inode, di_bh, pos); | 2217 | ret = ocfs2_zero_tail(inode, di_bh, pos); |
2218 | else | 2218 | else |
2219 | ret = ocfs2_expand_nonsparse_inode(inode, di_bh, pos, | 2219 | ret = ocfs2_expand_nonsparse_inode(inode, di_bh, pos, |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 977763d4c27d..b048d4fa3959 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -3072,7 +3072,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
3072 | * We need to return the correct block within the | 3072 | * We need to return the correct block within the |
3073 | * cluster which should hold our entry. | 3073 | * cluster which should hold our entry. |
3074 | */ | 3074 | */ |
3075 | off = ocfs2_dx_dir_hash_idx(OCFS2_SB(dir->i_sb), | 3075 | off = ocfs2_dx_dir_hash_idx(osb, |
3076 | &lookup->dl_hinfo); | 3076 | &lookup->dl_hinfo); |
3077 | get_bh(dx_leaves[off]); | 3077 | get_bh(dx_leaves[off]); |
3078 | lookup->dl_dx_leaf_bh = dx_leaves[off]; | 3078 | lookup->dl_dx_leaf_bh = dx_leaves[off]; |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 9479f99c2145..bc746e821d53 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -1756,8 +1756,7 @@ int ocfs2_rw_lock(struct inode *inode, int write) | |||
1756 | 1756 | ||
1757 | level = write ? DLM_LOCK_EX : DLM_LOCK_PR; | 1757 | level = write ? DLM_LOCK_EX : DLM_LOCK_PR; |
1758 | 1758 | ||
1759 | status = ocfs2_cluster_lock(OCFS2_SB(inode->i_sb), lockres, level, 0, | 1759 | status = ocfs2_cluster_lock(osb, lockres, level, 0, 0); |
1760 | 0); | ||
1761 | if (status < 0) | 1760 | if (status < 0) |
1762 | mlog_errno(status); | 1761 | mlog_errno(status); |
1763 | 1762 | ||
@@ -1796,7 +1795,7 @@ void ocfs2_rw_unlock(struct inode *inode, int write) | |||
1796 | write ? "EXMODE" : "PRMODE"); | 1795 | write ? "EXMODE" : "PRMODE"); |
1797 | 1796 | ||
1798 | if (!ocfs2_mount_local(osb)) | 1797 | if (!ocfs2_mount_local(osb)) |
1799 | ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level); | 1798 | ocfs2_cluster_unlock(osb, lockres, level); |
1800 | } | 1799 | } |
1801 | 1800 | ||
1802 | /* | 1801 | /* |
@@ -1816,8 +1815,7 @@ int ocfs2_open_lock(struct inode *inode) | |||
1816 | 1815 | ||
1817 | lockres = &OCFS2_I(inode)->ip_open_lockres; | 1816 | lockres = &OCFS2_I(inode)->ip_open_lockres; |
1818 | 1817 | ||
1819 | status = ocfs2_cluster_lock(OCFS2_SB(inode->i_sb), lockres, | 1818 | status = ocfs2_cluster_lock(osb, lockres, DLM_LOCK_PR, 0, 0); |
1820 | DLM_LOCK_PR, 0, 0); | ||
1821 | if (status < 0) | 1819 | if (status < 0) |
1822 | mlog_errno(status); | 1820 | mlog_errno(status); |
1823 | 1821 | ||
@@ -1854,8 +1852,7 @@ int ocfs2_try_open_lock(struct inode *inode, int write) | |||
1854 | * other nodes and the -EAGAIN will indicate to the caller that | 1852 | * other nodes and the -EAGAIN will indicate to the caller that |
1855 | * this inode is still in use. | 1853 | * this inode is still in use. |
1856 | */ | 1854 | */ |
1857 | status = ocfs2_cluster_lock(OCFS2_SB(inode->i_sb), lockres, | 1855 | status = ocfs2_cluster_lock(osb, lockres, level, DLM_LKF_NOQUEUE, 0); |
1858 | level, DLM_LKF_NOQUEUE, 0); | ||
1859 | 1856 | ||
1860 | out: | 1857 | out: |
1861 | return status; | 1858 | return status; |
@@ -1876,11 +1873,9 @@ void ocfs2_open_unlock(struct inode *inode) | |||
1876 | goto out; | 1873 | goto out; |
1877 | 1874 | ||
1878 | if(lockres->l_ro_holders) | 1875 | if(lockres->l_ro_holders) |
1879 | ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, | 1876 | ocfs2_cluster_unlock(osb, lockres, DLM_LOCK_PR); |
1880 | DLM_LOCK_PR); | ||
1881 | if(lockres->l_ex_holders) | 1877 | if(lockres->l_ex_holders) |
1882 | ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, | 1878 | ocfs2_cluster_unlock(osb, lockres, DLM_LOCK_EX); |
1883 | DLM_LOCK_EX); | ||
1884 | 1879 | ||
1885 | out: | 1880 | out: |
1886 | return; | 1881 | return; |
@@ -2601,9 +2596,9 @@ void ocfs2_inode_unlock(struct inode *inode, | |||
2601 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 2596 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
2602 | ex ? "EXMODE" : "PRMODE"); | 2597 | ex ? "EXMODE" : "PRMODE"); |
2603 | 2598 | ||
2604 | if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb)) && | 2599 | if (!ocfs2_is_hard_readonly(osb) && |
2605 | !ocfs2_mount_local(osb)) | 2600 | !ocfs2_mount_local(osb)) |
2606 | ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level); | 2601 | ocfs2_cluster_unlock(osb, lockres, level); |
2607 | } | 2602 | } |
2608 | 2603 | ||
2609 | /* | 2604 | /* |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 5d1784a365a3..9d8c3ee05c39 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -296,7 +296,7 @@ int ocfs2_update_inode_atime(struct inode *inode, | |||
296 | ocfs2_journal_dirty(handle, bh); | 296 | ocfs2_journal_dirty(handle, bh); |
297 | 297 | ||
298 | out_commit: | 298 | out_commit: |
299 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); | 299 | ocfs2_commit_trans(osb, handle); |
300 | out: | 300 | out: |
301 | return ret; | 301 | return ret; |
302 | } | 302 | } |
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index d51b80edd972..152f65b9c60e 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -1135,7 +1135,7 @@ static void ocfs2_clear_inode(struct inode *inode) | |||
1135 | trace_ocfs2_clear_inode((unsigned long long)oi->ip_blkno, | 1135 | trace_ocfs2_clear_inode((unsigned long long)oi->ip_blkno, |
1136 | inode->i_nlink); | 1136 | inode->i_nlink); |
1137 | 1137 | ||
1138 | mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, | 1138 | mlog_bug_on_msg(osb == NULL, |
1139 | "Inode=%lu\n", inode->i_ino); | 1139 | "Inode=%lu\n", inode->i_ino); |
1140 | 1140 | ||
1141 | dquot_drop(inode); | 1141 | dquot_drop(inode); |
@@ -1150,7 +1150,7 @@ static void ocfs2_clear_inode(struct inode *inode) | |||
1150 | ocfs2_mark_lockres_freeing(osb, &oi->ip_inode_lockres); | 1150 | ocfs2_mark_lockres_freeing(osb, &oi->ip_inode_lockres); |
1151 | ocfs2_mark_lockres_freeing(osb, &oi->ip_open_lockres); | 1151 | ocfs2_mark_lockres_freeing(osb, &oi->ip_open_lockres); |
1152 | 1152 | ||
1153 | ocfs2_resv_discard(&OCFS2_SB(inode->i_sb)->osb_la_resmap, | 1153 | ocfs2_resv_discard(&osb->osb_la_resmap, |
1154 | &oi->ip_la_data_resv); | 1154 | &oi->ip_la_data_resv); |
1155 | ocfs2_resv_init_once(&oi->ip_la_data_resv); | 1155 | ocfs2_resv_init_once(&oi->ip_la_data_resv); |
1156 | 1156 | ||
@@ -1223,7 +1223,7 @@ static void ocfs2_clear_inode(struct inode *inode) | |||
1223 | * the journal is flushed before journal shutdown. Thus it is safe to | 1223 | * the journal is flushed before journal shutdown. Thus it is safe to |
1224 | * have inodes get cleaned up after journal shutdown. | 1224 | * have inodes get cleaned up after journal shutdown. |
1225 | */ | 1225 | */ |
1226 | jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal, | 1226 | jbd2_journal_release_jbd_inode(osb->journal->j_journal, |
1227 | &oi->ip_jinode); | 1227 | &oi->ip_jinode); |
1228 | } | 1228 | } |
1229 | 1229 | ||
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index ab156e35ec00..323b162fb401 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -3359,7 +3359,7 @@ static int ocfs2_replace_cow(struct ocfs2_cow_context *context) | |||
3359 | unsigned int ext_flags; | 3359 | unsigned int ext_flags; |
3360 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 3360 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
3361 | 3361 | ||
3362 | if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) { | 3362 | if (!ocfs2_refcount_tree(osb)) { |
3363 | return ocfs2_error(inode->i_sb, "Inode %lu want to use refcount tree, but the feature bit is not set in the super block\n", | 3363 | return ocfs2_error(inode->i_sb, "Inode %lu want to use refcount tree, but the feature bit is not set in the super block\n", |
3364 | inode->i_ino); | 3364 | inode->i_ino); |
3365 | } | 3365 | } |
@@ -3707,7 +3707,7 @@ int ocfs2_add_refcount_flag(struct inode *inode, | |||
3707 | trace_ocfs2_add_refcount_flag(ref_blocks, credits); | 3707 | trace_ocfs2_add_refcount_flag(ref_blocks, credits); |
3708 | 3708 | ||
3709 | if (ref_blocks) { | 3709 | if (ref_blocks) { |
3710 | ret = ocfs2_reserve_new_metadata_blocks(OCFS2_SB(inode->i_sb), | 3710 | ret = ocfs2_reserve_new_metadata_blocks(osb, |
3711 | ref_blocks, &meta_ac); | 3711 | ref_blocks, &meta_ac); |
3712 | if (ret) { | 3712 | if (ret) { |
3713 | mlog_errno(ret); | 3713 | mlog_errno(ret); |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index d8f5f6ce99dc..40be6474e3d1 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -387,7 +387,7 @@ static int ocfs2_block_group_fill(handle_t *handle, | |||
387 | 387 | ||
388 | memset(bg, 0, sb->s_blocksize); | 388 | memset(bg, 0, sb->s_blocksize); |
389 | strcpy(bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE); | 389 | strcpy(bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE); |
390 | bg->bg_generation = cpu_to_le32(OCFS2_SB(sb)->fs_generation); | 390 | bg->bg_generation = cpu_to_le32(osb->fs_generation); |
391 | bg->bg_size = cpu_to_le16(ocfs2_group_bitmap_size(sb, 1, | 391 | bg->bg_size = cpu_to_le16(ocfs2_group_bitmap_size(sb, 1, |
392 | osb->s_feature_incompat)); | 392 | osb->s_feature_incompat)); |
393 | bg->bg_chain = cpu_to_le16(my_chain); | 393 | bg->bg_chain = cpu_to_le16(my_chain); |
@@ -1521,7 +1521,7 @@ static int ocfs2_cluster_group_search(struct inode *inode, | |||
1521 | OCFS2_I(inode)->ip_clusters, max_bits); | 1521 | OCFS2_I(inode)->ip_clusters, max_bits); |
1522 | } | 1522 | } |
1523 | 1523 | ||
1524 | ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb), | 1524 | ret = ocfs2_block_group_find_clear_bits(osb, |
1525 | group_bh, bits_wanted, | 1525 | group_bh, bits_wanted, |
1526 | max_bits, res); | 1526 | max_bits, res); |
1527 | if (ret) | 1527 | if (ret) |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index ffa4952d432b..e4d54d2805d6 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -423,10 +423,10 @@ static int ocfs2_sync_fs(struct super_block *sb, int wait) | |||
423 | ocfs2_schedule_truncate_log_flush(osb, 0); | 423 | ocfs2_schedule_truncate_log_flush(osb, 0); |
424 | } | 424 | } |
425 | 425 | ||
426 | if (jbd2_journal_start_commit(OCFS2_SB(sb)->journal->j_journal, | 426 | if (jbd2_journal_start_commit(osb->journal->j_journal, |
427 | &target)) { | 427 | &target)) { |
428 | if (wait) | 428 | if (wait) |
429 | jbd2_log_wait_commit(OCFS2_SB(sb)->journal->j_journal, | 429 | jbd2_log_wait_commit(osb->journal->j_journal, |
430 | target); | 430 | target); |
431 | } | 431 | } |
432 | return 0; | 432 | return 0; |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index c261c1dfd374..3a24ce3deb01 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -3564,7 +3564,7 @@ int ocfs2_xattr_set(struct inode *inode, | |||
3564 | .not_found = -ENODATA, | 3564 | .not_found = -ENODATA, |
3565 | }; | 3565 | }; |
3566 | 3566 | ||
3567 | if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb))) | 3567 | if (!ocfs2_supports_xattr(osb)) |
3568 | return -EOPNOTSUPP; | 3568 | return -EOPNOTSUPP; |
3569 | 3569 | ||
3570 | /* | 3570 | /* |