[PATCH 1/9 linux-next] pagemap.h: declare dir_pages()

From: Fabian Frederick
Date: Sun May 24 2015 - 11:24:32 EST


That function was declared in a lot of filesystems to calculate
directory pages.

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
include/linux/pagemap.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7c37907..0ec1a22 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -661,4 +661,10 @@ static inline int add_to_page_cache(struct page *page,
return error;
}

+static inline unsigned long dir_pages(struct inode *inode)
+{
+ return (unsigned long)(inode->i_size + PAGE_CACHE_SIZE - 1) >>
+ PAGE_CACHE_SHIFT;
+}
+
#endif /* _LINUX_PAGEMAP_H */
--
2.4.1

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