mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	Evgeniy Dushistov <dushistov@mail.ru>
Subject: [PATCH 3/9 linux-next] ufs: use dir_pages instead of ufs_dir_pages()
Date: Sun, 24 May 2015 17:19:43 +0200	[thread overview]
Message-ID: <1432480791-31396-4-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1432480791-31396-1-git-send-email-fabf@skynet.be>

dir_pages was declared in a lot of filesystems.
Use newly dir_pages() from pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/ufs/dir.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 1bfe8ca..6f44a8b 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -65,11 +65,6 @@ static inline void ufs_put_page(struct page *page)
 	page_cache_release(page);
 }
 
-static inline unsigned long ufs_dir_pages(struct inode *inode)
-{
-	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 ino_t ufs_inode_by_name(struct inode *dir, const struct qstr *qstr)
 {
 	ino_t res = 0;
@@ -256,7 +251,7 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr,
 	int namelen = qstr->len;
 	unsigned reclen = UFS_DIR_REC_LEN(namelen);
 	unsigned long start, n;
-	unsigned long npages = ufs_dir_pages(dir);
+	unsigned long npages = dir_pages(dir);
 	struct page *page = NULL;
 	struct ufs_inode_info *ui = UFS_I(dir);
 	struct ufs_dir_entry *de;
@@ -320,7 +315,7 @@ int ufs_add_link(struct dentry *dentry, struct inode *inode)
 	unsigned short rec_len, name_len;
 	struct page *page = NULL;
 	struct ufs_dir_entry *de;
-	unsigned long npages = ufs_dir_pages(dir);
+	unsigned long npages = dir_pages(dir);
 	unsigned long n;
 	char *kaddr;
 	loff_t pos;
@@ -437,7 +432,7 @@ ufs_readdir(struct file *file, struct dir_context *ctx)
 	struct super_block *sb = inode->i_sb;
 	unsigned int offset = pos & ~PAGE_CACHE_MASK;
 	unsigned long n = pos >> PAGE_CACHE_SHIFT;
-	unsigned long npages = ufs_dir_pages(inode);
+	unsigned long npages = dir_pages(inode);
 	unsigned chunk_mask = ~(UFS_SB(sb)->s_uspi->s_dirblksize - 1);
 	int need_revalidate = file->f_version != inode->i_version;
 	unsigned flags = UFS_SB(sb)->s_flags;
@@ -608,7 +603,7 @@ int ufs_empty_dir(struct inode * inode)
 {
 	struct super_block *sb = inode->i_sb;
 	struct page *page = NULL;
-	unsigned long i, npages = ufs_dir_pages(inode);
+	unsigned long i, npages = dir_pages(inode);
 
 	for (i = 0; i < npages; i++) {
 		char *kaddr;
-- 
2.4.1


  parent reply	other threads:[~2015-05-24 15:24 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 ` [PATCH 1/9 linux-next] pagemap.h: declare dir_pages() Fabian Frederick
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 ` Fabian Frederick [this message]
2015-05-24 15:19 ` [PATCH 4/9 linux-next] fs/qnx6: " 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-4-git-send-email-fabf@skynet.be \
    --to=fabf@skynet.be \
    --cc=dushistov@mail.ru \
    --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®