diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-30 07:45:30 -0400 |
---|---|---|
committer | Artem Bityutskiy <dedekind1@gmail.com> | 2011-07-04 03:54:27 -0400 |
commit | f42eed7cba7f83197b0ffbb023e7d89a0b2fd71d (patch) | |
tree | b5590faffe190cd1401945e13c66684bec2f5b48 /fs/ubifs/tnc_commit.c | |
parent | 1f42596ec0a7d3d50a494d95e3f1afbd117250f8 (diff) |
UBIFS: harmonize znode flag helpers
We have 3 znode flags: cow, obsolete, dirty. For the last flag we have a
'ubifs_zn_dirty()' helper function, but for the other 2 flags we use
'test_bit()' directly.
This patch makes the situation more consistent and introduces helpers for the
other 2 flags: 'ubifs_zn_cow()' and 'ubifs_zn_obsolete()'.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/tnc_commit.c')
-rw-r--r-- | fs/ubifs/tnc_commit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ubifs/tnc_commit.c b/fs/ubifs/tnc_commit.c index 8315387be3fd..f50c3e5da263 100644 --- a/fs/ubifs/tnc_commit.c +++ b/fs/ubifs/tnc_commit.c | |||
@@ -87,7 +87,7 @@ static int make_idx_node(struct ubifs_info *c, struct ubifs_idx_node *idx, | |||
87 | atomic_long_dec(&c->dirty_zn_cnt); | 87 | atomic_long_dec(&c->dirty_zn_cnt); |
88 | 88 | ||
89 | ubifs_assert(ubifs_zn_dirty(znode)); | 89 | ubifs_assert(ubifs_zn_dirty(znode)); |
90 | ubifs_assert(test_bit(COW_ZNODE, &znode->flags)); | 90 | ubifs_assert(ubifs_zn_cow(znode)); |
91 | 91 | ||
92 | __clear_bit(DIRTY_ZNODE, &znode->flags); | 92 | __clear_bit(DIRTY_ZNODE, &znode->flags); |
93 | __clear_bit(COW_ZNODE, &znode->flags); | 93 | __clear_bit(COW_ZNODE, &znode->flags); |
@@ -639,7 +639,7 @@ static int get_znodes_to_commit(struct ubifs_info *c) | |||
639 | } | 639 | } |
640 | cnt += 1; | 640 | cnt += 1; |
641 | while (1) { | 641 | while (1) { |
642 | ubifs_assert(!test_bit(COW_ZNODE, &znode->flags)); | 642 | ubifs_assert(!ubifs_zn_cow(znode)); |
643 | __set_bit(COW_ZNODE, &znode->flags); | 643 | __set_bit(COW_ZNODE, &znode->flags); |
644 | znode->alt = 0; | 644 | znode->alt = 0; |
645 | cnext = find_next_dirty(znode); | 645 | cnext = find_next_dirty(znode); |
@@ -888,7 +888,7 @@ static int write_index(struct ubifs_info *c) | |||
888 | cnext = znode->cnext; | 888 | cnext = znode->cnext; |
889 | 889 | ||
890 | ubifs_assert(ubifs_zn_dirty(znode)); | 890 | ubifs_assert(ubifs_zn_dirty(znode)); |
891 | ubifs_assert(test_bit(COW_ZNODE, &znode->flags)); | 891 | ubifs_assert(ubifs_zn_cow(znode)); |
892 | 892 | ||
893 | /* | 893 | /* |
894 | * It is important that other threads should see %DIRTY_ZNODE | 894 | * It is important that other threads should see %DIRTY_ZNODE |
@@ -983,7 +983,7 @@ static void free_obsolete_znodes(struct ubifs_info *c) | |||
983 | do { | 983 | do { |
984 | znode = cnext; | 984 | znode = cnext; |
985 | cnext = znode->cnext; | 985 | cnext = znode->cnext; |
986 | if (test_bit(OBSOLETE_ZNODE, &znode->flags)) | 986 | if (ubifs_zn_obsolete(znode)) |
987 | kfree(znode); | 987 | kfree(znode); |
988 | else { | 988 | else { |
989 | znode->cnext = NULL; | 989 | znode->cnext = NULL; |