Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1280549 > unrolled thread

[PATCH 2/3] f2fs: clean up code with __has_cursum_space

Started byChao Yu <chao2.yu@samsung.com>
First post2015-12-01 04:50 +0100
Last post2015-12-01 04:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/3] f2fs: clean up code with __has_cursum_space Chao Yu <chao2.yu@samsung.com> - 2015-12-01 04:50 +0100

#1280549 — [PATCH 2/3] f2fs: clean up code with __has_cursum_space

FromChao Yu <chao2.yu@samsung.com>
Date2015-12-01 04:50 +0100
Subject[PATCH 2/3] f2fs: clean up code with __has_cursum_space
Message-ID<qAK6Z-4gM-5@gated-at.bofh.it>
Clean up codes in lookup_journal_in_cursum() with __has_cursum_space().

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 fs/f2fs/segment.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index ed2c5de..74c4748 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1740,13 +1740,13 @@ int lookup_journal_in_cursum(struct f2fs_summary_block *sum, int type,
 			if (le32_to_cpu(nid_in_journal(sum, i)) == val)
 				return i;
 		}
-		if (alloc && nats_in_cursum(sum) < NAT_JOURNAL_ENTRIES)
+		if (alloc && __has_cursum_space(sum, 1, NAT_JOURNAL))
 			return update_nats_in_cursum(sum, 1);
 	} else if (type == SIT_JOURNAL) {
 		for (i = 0; i < sits_in_cursum(sum); i++)
 			if (le32_to_cpu(segno_in_journal(sum, i)) == val)
 				return i;
-		if (alloc && sits_in_cursum(sum) < SIT_JOURNAL_ENTRIES)
+		if (alloc && __has_cursum_space(sum, 1, SIT_JOURNAL))
 			return update_sits_in_cursum(sum, 1);
 	}
 	return -1;
-- 
2.6.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web