Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: remove le_bitmap_clear()
@ 2018-04-18 21:30 Howard McLauchlan
  2018-04-18 21:30 ` [PATCH 2/2] btrfs: optimize free space tree bitmap conversion Howard McLauchlan
  2018-04-18 22:14 ` [PATCH 1/2] btrfs: remove le_bitmap_clear() David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Howard McLauchlan @ 2018-04-18 21:30 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Chris Mason, Josef Bacik, David Sterba, kernel-team,
	Howard McLauchlan

le_bitmap_clear() was implemented as a parallel to le_bitmap_set() but
is actually not being used. This patch removes it.

Signed-off-by: Howard McLauchlan <hmclauchlan@fb.com>
---
 fs/btrfs/extent_io.c | 20 --------------------
 fs/btrfs/extent_io.h |  1 -
 2 files changed, 21 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index e99b329002cf..cf50278f1c59 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5640,26 +5640,6 @@ void le_bitmap_set(u8 *map, unsigned int start, int len)
 	}
 }
 
-void le_bitmap_clear(u8 *map, unsigned int start, int len)
-{
-	u8 *p = map + BIT_BYTE(start);
-	const unsigned int size = start + len;
-	int bits_to_clear = BITS_PER_BYTE - (start % BITS_PER_BYTE);
-	u8 mask_to_clear = BITMAP_FIRST_BYTE_MASK(start);
-
-	while (len - bits_to_clear >= 0) {
-		*p &= ~mask_to_clear;
-		len -= bits_to_clear;
-		bits_to_clear = BITS_PER_BYTE;
-		mask_to_clear = ~0;
-		p++;
-	}
-	if (len) {
-		mask_to_clear &= BITMAP_LAST_BYTE_MASK(size);
-		*p &= ~mask_to_clear;
-	}
-}
-
 /*
  * eb_bitmap_offset() - calculate the page and offset of the byte containing the
  * given bit number
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index a53009694b16..4b8b072d9594 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -85,7 +85,6 @@ static inline int le_test_bit(int nr, const u8 *addr)
 }
 
 void le_bitmap_set(u8 *map, unsigned int start, int len);
-void le_bitmap_clear(u8 *map, unsigned int start, int len);
 
 struct extent_state;
 struct btrfs_root;
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-18 23:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-18 21:30 [PATCH 1/2] btrfs: remove le_bitmap_clear() Howard McLauchlan
2018-04-18 21:30 ` [PATCH 2/2] btrfs: optimize free space tree bitmap conversion Howard McLauchlan
2018-04-18 22:26   ` David Sterba
2018-04-18 23:09     ` Howard McLauchlan
2018-04-18 22:14 ` [PATCH 1/2] btrfs: remove le_bitmap_clear() David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox