From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Fabian Frederick <fabf@skynet.be>
Subject: [PATCH 1/9 linux-next] pagemap.h: declare dir_pages()
Date: Sun, 24 May 2015 17:19:41 +0200 [thread overview]
Message-ID: <1432480791-31396-2-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1432480791-31396-1-git-send-email-fabf@skynet.be>
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
next prev parent reply other threads:[~2015-05-24 15:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
2015-05-24 15:19 ` Fabian Frederick [this message]
2015-05-24 15:19 ` [PATCH 2/9 linux-next] nilfs2: remove dir_pages() declaration Fabian Frederick
2015-05-25 1:06 ` Ryusuke Konishi
2015-05-24 15:19 ` [PATCH 3/9 linux-next] ufs: use dir_pages instead of ufs_dir_pages() Fabian Frederick
2015-05-24 15:19 ` [PATCH 4/9 linux-next] fs/qnx6: remove dir_pages() declaration Fabian Frederick
2015-05-24 15:19 ` [PATCH 5/9 linux-next] ext2: " Fabian Frederick
2015-05-24 15:19 ` [PATCH 6/9 linux-next] minix: " Fabian Frederick
2015-05-24 15:19 ` [PATCH 7/9 linux-next] exofs: " Fabian Frederick
2015-05-24 15:19 ` [PATCH 8/9 linux-next] sysv: " Fabian Frederick
2015-06-05 14:43 ` [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432480791-31396-2-git-send-email-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®