diff mbox

[1/3] VFS: Rename do_fallocate() to vfs_fallocate()

Message ID 1410274182-30740-2-git-send-email-Anna.Schumaker@Netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Schumaker, Anna Sept. 9, 2014, 2:49 p.m. UTC
From: Anna Schumaker <Anna.Schumaker@netapp.com>

This function needs to be exported so it can be used by the NFSD module
when responding to ALLOCATE and DEALLOCATE operations.  Christoph Hellwig
suggested renaming the function to match how other vfs functions are named.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 drivers/staging/android/ashmem.c | 2 +-
 fs/ioctl.c                       | 2 +-
 fs/open.c                        | 5 +++--
 include/linux/fs.h               | 2 +-
 mm/madvise.c                     | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

Comments

Christoph Hellwig Sept. 9, 2014, 3:50 p.m. UTC | #1
On Tue, Sep 09, 2014 at 10:49:40AM -0400, Anna.Schumaker@netapp.com wrote:
> From: Anna Schumaker <Anna.Schumaker@netapp.com>
> 
> This function needs to be exported so it can be used by the NFSD module
> when responding to ALLOCATE and DEALLOCATE operations.  Christoph Hellwig
> suggested renaming the function to match how other vfs functions are named.
> 
> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. Bruce Fields Sept. 10, 2014, 7:43 p.m. UTC | #2
On Tue, Sep 09, 2014 at 08:50:19AM -0700, Christoph Hellwig wrote:
> On Tue, Sep 09, 2014 at 10:49:40AM -0400, Anna.Schumaker@netapp.com wrote:
> > From: Anna Schumaker <Anna.Schumaker@netapp.com>
> > 
> > This function needs to be exported so it can be used by the NFSD module
> > when responding to ALLOCATE and DEALLOCATE operations.  Christoph Hellwig
> > suggested renaming the function to match how other vfs functions are named.
> > 
> > Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> 
> Looks good,
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

I'd like to be able to take this into through the nfsd tree if the nfsd
patches are going to depend on it.

Anna, on next posting maybe you could make sure to cc: the reelevant
people (I'm not sure who...) so I can get the right ACKs for that?

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Sept. 10, 2014, 10:12 p.m. UTC | #3
On Wed, Sep 10, 2014 at 03:43:42PM -0400, J. Bruce Fields wrote:
> On Tue, Sep 09, 2014 at 08:50:19AM -0700, Christoph Hellwig wrote:
> > On Tue, Sep 09, 2014 at 10:49:40AM -0400, Anna.Schumaker@netapp.com wrote:
> > > From: Anna Schumaker <Anna.Schumaker@netapp.com>
> > > 
> > > This function needs to be exported so it can be used by the NFSD module
> > > when responding to ALLOCATE and DEALLOCATE operations.  Christoph Hellwig
> > > suggested renaming the function to match how other vfs functions are named.
> > > 
> > > Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> > 
> > Looks good,
> > 
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> I'd like to be able to take this into through the nfsd tree if the nfsd
> patches are going to depend on it.
> 
> Anna, on next posting maybe you could make sure to cc: the reelevant
> people (I'm not sure who...) so I can get the right ACKs for that?

Cc Al and fsdevel, please.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 713a972..9c799987 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -446,7 +446,7 @@  ashmem_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 		loff_t start = range->pgstart * PAGE_SIZE;
 		loff_t end = (range->pgend + 1) * PAGE_SIZE;
 
-		do_fallocate(range->asma->file,
+		vfs_fallocate(range->asma->file,
 				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
 				start, end - start);
 		range->purged = ASHMEM_WAS_PURGED;
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 8ac3fad..0bd61421 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -443,7 +443,7 @@  int ioctl_preallocate(struct file *filp, void __user *argp)
 		return -EINVAL;
 	}
 
-	return do_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
+	return vfs_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
 }
 
 static int file_ioctl(struct file *filp, unsigned int cmd,
diff --git a/fs/open.c b/fs/open.c
index d6fd3ac..c94449b 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -222,7 +222,7 @@  SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
 #endif /* BITS_PER_LONG == 32 */
 
 
-int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
+int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 {
 	struct inode *inode = file_inode(file);
 	long ret;
@@ -298,6 +298,7 @@  int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 	sb_end_write(inode->i_sb);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(vfs_fallocate);
 
 SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
 {
@@ -305,7 +306,7 @@  SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
 	int error = -EBADF;
 
 	if (f.file) {
-		error = do_fallocate(f.file, mode, offset, len);
+		error = vfs_fallocate(f.file, mode, offset, len);
 		fdput(f);
 	}
 	return error;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9418772..476f555 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2049,7 +2049,7 @@  struct filename {
 extern long vfs_truncate(struct path *, loff_t);
 extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
 		       struct file *filp);
-extern int do_fallocate(struct file *file, int mode, loff_t offset,
+extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
 			loff_t len);
 extern long do_sys_open(int dfd, const char __user *filename, int flags,
 			umode_t mode);
diff --git a/mm/madvise.c b/mm/madvise.c
index 0938b30..a271adc 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -326,7 +326,7 @@  static long madvise_remove(struct vm_area_struct *vma,
 	 */
 	get_file(f);
 	up_read(&current->mm->mmap_sem);
-	error = do_fallocate(f,
+	error = vfs_fallocate(f,
 				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
 				offset, end - start);
 	fput(f);