[PATCH] fs: remove the block_size_bits helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a trivial wrapper around ilog2, with a totally confusing comment.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 fs/buffer.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 64fe82ec65ff1f..c89eb509d6049c 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1658,19 +1658,6 @@ void clean_bdev_aliases(struct block_device *bdev, sector_t block, sector_t len)
 }
 EXPORT_SYMBOL(clean_bdev_aliases);
 
-/*
- * Size is a power-of-two in the range 512..PAGE_SIZE,
- * and the case we care about most is PAGE_SIZE.
- *
- * So this *could* possibly be written with those
- * constraints in mind (relevant mostly if some
- * architecture has a slow bit-scan instruction)
- */
-static inline int block_size_bits(unsigned int blocksize)
-{
-	return ilog2(blocksize);
-}
-
 static struct buffer_head *create_page_buffers(struct page *page, struct inode *inode, unsigned int b_state)
 {
 	BUG_ON(!PageLocked(page));
@@ -1737,7 +1724,7 @@ int __block_write_full_page(struct inode *inode, struct page *page,
 
 	bh = head;
 	blocksize = bh->b_size;
-	bbits = block_size_bits(blocksize);
+	bbits = ilog2(blocksize);
 
 	block = (sector_t)page->index << (PAGE_SHIFT - bbits);
 	last_block = (i_size_read(inode) - 1) >> bbits;
@@ -1990,7 +1977,7 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
 
 	head = create_page_buffers(page, inode, 0);
 	blocksize = head->b_size;
-	bbits = block_size_bits(blocksize);
+	bbits = ilog2(blocksize);
 
 	block = (sector_t)page->index << (PAGE_SHIFT - bbits);
 
@@ -2268,7 +2255,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
 
 	head = create_page_buffers(page, inode, 0);
 	blocksize = head->b_size;
-	bbits = block_size_bits(blocksize);
+	bbits = ilog2(blocksize);
 
 	iblock = (sector_t)page->index << (PAGE_SHIFT - bbits);
 	lblock = (i_size_read(inode)+blocksize-1) >> bbits;
-- 
2.26.2




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux