From: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
To: Anna Schumaker <Anna.Schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
Cc: viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
hch-jcswGhMUV9g@public.gmane.org,
Trond.Myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org
Subject: Re: [PATCH] VFS: Rename do_fallocate() to vfs_fallocate()
Date: Wed, 1 Oct 2014 15:27:23 -0400 [thread overview]
Message-ID: <20141001192723.GC29675@fieldses.org> (raw)
In-Reply-To: <1412190907-30307-1-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
On Wed, Oct 01, 2014 at 03:15:07PM -0400, Anna Schumaker wrote:
> From: Anna Schumaker <Anna.Schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
>
> This function needs to be exported so it can be used by the NFSD module
> when responding to the new ALLOCATE and DEALLOCATE operations in NFS
> v4.2. Christoph Hellwig suggested renaming the function to stay
> consistent with how other vfs functions are named.
ALLOCATE/DEALLOCATE have already gotten some review and look close to
done, so will probably be in 3.19, and having this in now would simplify
merging--ACK.
--b.
>
> Signed-off-by: Anna Schumaker <Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
> ---
> 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(-)
>
> 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(¤t->mm->mmap_sem);
> - error = do_fallocate(f,
> + error = vfs_fallocate(f,
> FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> offset, end - start);
> fput(f);
> --
> 2.1.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-10-01 19:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 19:15 [PATCH] VFS: Rename do_fallocate() to vfs_fallocate() Anna Schumaker
[not found] ` <1412190907-30307-1-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2014-10-01 19:27 ` J. Bruce Fields [this message]
2014-10-01 21:04 ` Christoph Hellwig
[not found] ` <20141001210451.GB6680-jcswGhMUV9g@public.gmane.org>
2014-10-23 21:23 ` Anna Schumaker
[not found] ` <544971CE.9090808-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2014-10-24 6:48 ` Christoph Hellwig
[not found] ` <20141024064800.GA10811-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-10-31 10:36 ` 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=20141001192723.GC29675@fieldses.org \
--to=bfields-uc3wqj2krung9huczpvpmw@public.gmane.org \
--cc=Anna.Schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
--cc=Trond.Myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org \
--cc=hch-jcswGhMUV9g@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).