Re: [patch 14/19] Use page_cache_xxx in ext2

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

 



On Thu, 29 Nov 2007, David Chinner wrote:

> I don't think that gives the same return value. The return value
> is supposed to be clamped at a maximum of page_cache_size(mapping).

Ok. So this?


ext2: Simplify some functions

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>

---
 fs/ext2/dir.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: mm/fs/ext2/dir.c
===================================================================
--- mm.orig/fs/ext2/dir.c	2007-11-28 20:13:07.387132777 -0800
+++ mm/fs/ext2/dir.c	2007-11-28 20:14:35.739632586 -0800
@@ -63,8 +63,7 @@ static inline void ext2_put_page(struct 
 
 static inline unsigned long dir_pages(struct inode *inode)
 {
-	return (inode->i_size+page_cache_size(inode->i_mapping)-1)>>
-			page_cache_shift(inode->i_mapping);
+	return page_cache_next(inode->i_mapping, inode->i_size);
 }
 
 /*
@@ -77,7 +76,7 @@ ext2_last_byte(struct inode *inode, unsi
 	unsigned last_byte = inode->i_size;
 	struct address_space *mapping = inode->i_mapping;
 
-	last_byte -= page_nr << page_cache_shift(mapping);
+	last_byte -= page_cache_pos(mapping, page_nr, 0);
 	if (last_byte > page_cache_size(mapping))
 		last_byte = page_cache_size(mapping);
 	return last_byte;
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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