LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9 linux-next] move dir_pages() to pagemap.h
@ 2015-05-24 15:19 Fabian Frederick
  2015-05-24 15:19 ` [PATCH 1/9 linux-next] pagemap.h: declare dir_pages() Fabian Frederick
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel
  Cc: Alexander Viro, Fabian Frederick, osd-dev, linux-ext4,
	linux-nilfs

This small patchset declares dir_pages() in pagemap.h and
removes declarations in each filesystems.

Fabian Frederick (9):
  pagemap.h: declare dir_pages()
  nilfs2: remove dir_pages() declaration
  ufs: use dir_pages instead of ufs_dir_pages()
  fs/qnx6: remove dir_pages() declaration
  ext2: remove dir_pages() declaration
  minix: remove dir_pages() declaration
  exofs: remove dir_pages() declaration
  sysv: remove dir_pages() declaration
  fs/freevxfs/vxfs_lookup.c: remove dir_pages() declaration

 fs/exofs/dir.c            |  6 ------
 fs/ext2/dir.c             |  5 -----
 fs/freevxfs/vxfs_lookup.c |  7 -------
 fs/minix/dir.c            |  5 -----
 fs/nilfs2/dir.c           |  5 -----
 fs/qnx6/dir.c             |  5 -----
 fs/sysv/dir.c             |  5 -----
 fs/ufs/dir.c              | 13 ++++---------
 include/linux/pagemap.h   |  6 ++++++
 9 files changed, 10 insertions(+), 47 deletions(-)

-- 
2.4.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/9 linux-next] pagemap.h: declare dir_pages()
  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
  2015-05-24 15:19 ` [PATCH 2/9 linux-next] nilfs2: remove dir_pages() declaration Fabian Frederick
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel; +Cc: Alexander Viro, Fabian Frederick

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/9 linux-next] nilfs2: remove dir_pages() declaration
  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 ` 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
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel
  Cc: Alexander Viro, Fabian Frederick, Ryusuke Konishi, linux-nilfs

dir_pages() is now declared in pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/nilfs2/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
index 0ee0bed..6b8b92b 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -61,11 +61,6 @@ static inline void nilfs_put_page(struct page *page)
 	page_cache_release(page);
 }
 
-static inline unsigned long dir_pages(struct inode *inode)
-{
-	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 /*
  * Return the offset into page `page_nr' of the last valid
  * byte in that page, plus one.
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/9 linux-next] ufs: use dir_pages instead of ufs_dir_pages()
  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-24 15:19 ` Fabian Frederick
  2015-05-24 15:19 ` [PATCH 4/9 linux-next] fs/qnx6: remove dir_pages() declaration Fabian Frederick
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel; +Cc: Alexander Viro, Fabian Frederick, Evgeniy Dushistov

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/9 linux-next] fs/qnx6: remove dir_pages() declaration
  2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
                   ` (2 preceding siblings ...)
  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 ` Fabian Frederick
  2015-05-24 15:19 ` [PATCH 5/9 linux-next] ext2: " Fabian Frederick
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel; +Cc: Alexander Viro, Fabian Frederick

dir_pages() is now declared in pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/qnx6/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/qnx6/dir.c b/fs/qnx6/dir.c
index 8d64bb5..e1f3727 100644
--- a/fs/qnx6/dir.c
+++ b/fs/qnx6/dir.c
@@ -32,11 +32,6 @@ static struct page *qnx6_get_page(struct inode *dir, unsigned long n)
 	return page;
 }
 
-static inline unsigned long dir_pages(struct inode *inode)
-{
-	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 static unsigned last_entry(struct inode *inode, unsigned long page_nr)
 {
 	unsigned long last_byte = inode->i_size;
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/9 linux-next] ext2: remove dir_pages() declaration
  2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
                   ` (3 preceding siblings ...)
  2015-05-24 15:19 ` [PATCH 4/9 linux-next] fs/qnx6: remove dir_pages() declaration Fabian Frederick
@ 2015-05-24 15:19 ` Fabian Frederick
  2015-05-24 15:19 ` [PATCH 6/9 linux-next] minix: " Fabian Frederick
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel; +Cc: Alexander Viro, Fabian Frederick, Jan Kara, linux-ext4

dir_pages() is now declared in pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/ext2/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 796b491..0c6638b 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -70,11 +70,6 @@ static inline void ext2_put_page(struct page *page)
 	page_cache_release(page);
 }
 
-static inline unsigned long dir_pages(struct inode *inode)
-{
-	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 /*
  * Return the offset into page `page_nr' of the last valid
  * byte in that page, plus one.
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/9 linux-next] minix: remove dir_pages() declaration
  2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
                   ` (4 preceding siblings ...)
  2015-05-24 15:19 ` [PATCH 5/9 linux-next] ext2: " Fabian Frederick
@ 2015-05-24 15:19 ` Fabian Frederick
  2015-05-24 15:19 ` [PATCH 7/9 linux-next] exofs: " Fabian Frederick
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel; +Cc: Alexander Viro, Fabian Frederick

dir_pages() is now declared in pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/minix/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index 118e4e7..d19ac25 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -45,11 +45,6 @@ minix_last_byte(struct inode *inode, unsigned long page_nr)
 	return last_byte;
 }
 
-static inline unsigned long dir_pages(struct inode *inode)
-{
-	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 static int dir_commit_chunk(struct page *page, loff_t pos, unsigned len)
 {
 	struct address_space *mapping = page->mapping;
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/9 linux-next] exofs: remove dir_pages() declaration
  2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
                   ` (5 preceding siblings ...)
  2015-05-24 15:19 ` [PATCH 6/9 linux-next] minix: " Fabian Frederick
@ 2015-05-24 15:19 ` 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
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel
  Cc: Alexander Viro, Fabian Frederick, Boaz Harrosh, Benny Halevy,
	osd-dev

dir_pages() is now declared in pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/exofs/dir.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c
index 4deb0b0..e5bb2ab 100644
--- a/fs/exofs/dir.c
+++ b/fs/exofs/dir.c
@@ -44,12 +44,6 @@ static inline void exofs_put_page(struct page *page)
 	page_cache_release(page);
 }
 
-/* Accesses dir's inode->i_size must be called under inode lock */
-static inline unsigned long dir_pages(struct inode *inode)
-{
-	return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
-}
-
 static unsigned exofs_last_byte(struct inode *inode, unsigned long page_nr)
 {
 	loff_t last_byte = inode->i_size;
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/9 linux-next] sysv: remove dir_pages() declaration
  2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
                   ` (6 preceding siblings ...)
  2015-05-24 15:19 ` [PATCH 7/9 linux-next] exofs: " Fabian Frederick
@ 2015-05-24 15:19 ` Fabian Frederick
  2015-06-05 14:43 ` [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Al Viro
  8 siblings, 0 replies; 11+ messages in thread
From: Fabian Frederick @ 2015-05-24 15:19 UTC (permalink / raw
  To: linux-kernel; +Cc: Alexander Viro, Fabian Frederick, Christoph Hellwig

dir_pages() is now declared in pagemap.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/sysv/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 8f3555f..63c1bcb 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -33,11 +33,6 @@ static inline void dir_put_page(struct page *page)
 	page_cache_release(page);
 }
 
-static inline unsigned long dir_pages(struct inode *inode)
-{
-	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 static int dir_commit_chunk(struct page *page, loff_t pos, unsigned len)
 {
 	struct address_space *mapping = page->mapping;
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/9 linux-next] nilfs2: remove dir_pages() declaration
  2015-05-24 15:19 ` [PATCH 2/9 linux-next] nilfs2: remove dir_pages() declaration Fabian Frederick
@ 2015-05-25  1:06   ` Ryusuke Konishi
  0 siblings, 0 replies; 11+ messages in thread
From: Ryusuke Konishi @ 2015-05-25  1:06 UTC (permalink / raw
  To: Fabian Frederick
  Cc: linux-kernel, Alexander Viro, linux-nilfs, Christoph Hellwig,
	Boaz Harrosh, Benny Halevy, osd-dev, Jan Kara, linux-ext4,
	Evgeniy Dushistov

On Sun, 24 May 2015 17:19:42 +0200, Fabian Frederick <fabf@skynet.be> wrote:
> dir_pages() is now declared in pagemap.h
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/nilfs2/dir.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
> index 0ee0bed..6b8b92b 100644
> --- a/fs/nilfs2/dir.c
> +++ b/fs/nilfs2/dir.c
> @@ -61,11 +61,6 @@ static inline void nilfs_put_page(struct page *page)
>  	page_cache_release(page);
>  }
>  
> -static inline unsigned long dir_pages(struct inode *inode)
> -{
> -	return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
> -}
> -

Can you include this and similar changes in the first patch
"pagemap.h: declare dir_pages()" ?

The first patch transiently breaks build because it inserts a
duplicate definition of the dir_pages() inline function until it gets
removed from each file system by the successive patches.

This series looks non-divisible except the patch of ufs.

Regards,
Ryusuke Konishi

>  /*
>   * Return the offset into page `page_nr' of the last valid
>   * byte in that page, plus one.
> -- 
> 2.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/9 linux-next] move dir_pages() to pagemap.h
  2015-05-24 15:19 [PATCH 0/9 linux-next] move dir_pages() to pagemap.h Fabian Frederick
                   ` (7 preceding siblings ...)
  2015-05-24 15:19 ` [PATCH 8/9 linux-next] sysv: " Fabian Frederick
@ 2015-06-05 14:43 ` Al Viro
  8 siblings, 0 replies; 11+ messages in thread
From: Al Viro @ 2015-06-05 14:43 UTC (permalink / raw
  To: Fabian Frederick; +Cc: linux-kernel, osd-dev, linux-ext4, linux-nilfs

On Sun, May 24, 2015 at 05:19:40PM +0200, Fabian Frederick wrote:
> This small patchset declares dir_pages() in pagemap.h and
> removes declarations in each filesystems.

Applied, with #2 and #4--9 folded into #1 - otherwise you get build breakage.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-05 14:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).