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

Fabian Frederick
2015-05-24T15:20:13Z

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

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
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