aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-11-07 14:44:25 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-11-07 16:17:44 -0500
commit72c72bdf7bf53353d2d8e055194d27f0128be92b (patch)
treecdca64b1d630c3b7d7c0d5fa9cb500aa9c3a9da6
parent9af94fc4e470deab3427d07551725f0bf844ebc8 (diff)
VFS: Rename do_fallocate() to vfs_fallocate()
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. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--drivers/staging/android/ashmem.c2
-rw-r--r--fs/ioctl.c2
-rw-r--r--fs/open.c5
-rw-r--r--include/linux/fs.h2
-rw-r--r--mm/madvise.c2
5 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index ad4f5790a76f..27eecfe1c410 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)
446 loff_t start = range->pgstart * PAGE_SIZE; 446 loff_t start = range->pgstart * PAGE_SIZE;
447 loff_t end = (range->pgend + 1) * PAGE_SIZE; 447 loff_t end = (range->pgend + 1) * PAGE_SIZE;
448 448
449 do_fallocate(range->asma->file, 449 vfs_fallocate(range->asma->file,
450 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 450 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
451 start, end - start); 451 start, end - start);
452 range->purged = ASHMEM_WAS_PURGED; 452 range->purged = ASHMEM_WAS_PURGED;
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 8ac3fad36192..0bd6142183ee 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -443,7 +443,7 @@ int ioctl_preallocate(struct file *filp, void __user *argp)
443 return -EINVAL; 443 return -EINVAL;
444 } 444 }
445 445
446 return do_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len); 446 return vfs_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
447} 447}
448 448
449static int file_ioctl(struct file *filp, unsigned int cmd, 449static int file_ioctl(struct file *filp, unsigned int cmd,
diff --git a/fs/open.c b/fs/open.c
index d6fd3acde134..c94449b2e582 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -222,7 +222,7 @@ SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
222#endif /* BITS_PER_LONG == 32 */ 222#endif /* BITS_PER_LONG == 32 */
223 223
224 224
225int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) 225int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
226{ 226{
227 struct inode *inode = file_inode(file); 227 struct inode *inode = file_inode(file);
228 long ret; 228 long ret;
@@ -298,6 +298,7 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
298 sb_end_write(inode->i_sb); 298 sb_end_write(inode->i_sb);
299 return ret; 299 return ret;
300} 300}
301EXPORT_SYMBOL_GPL(vfs_fallocate);
301 302
302SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) 303SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
303{ 304{
@@ -305,7 +306,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
305 int error = -EBADF; 306 int error = -EBADF;
306 307
307 if (f.file) { 308 if (f.file) {
308 error = do_fallocate(f.file, mode, offset, len); 309 error = vfs_fallocate(f.file, mode, offset, len);
309 fdput(f); 310 fdput(f);
310 } 311 }
311 return error; 312 return error;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a957d4366c24..a88718677579 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2032,7 +2032,7 @@ struct filename {
2032extern long vfs_truncate(struct path *, loff_t); 2032extern long vfs_truncate(struct path *, loff_t);
2033extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, 2033extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
2034 struct file *filp); 2034 struct file *filp);
2035extern int do_fallocate(struct file *file, int mode, loff_t offset, 2035extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
2036 loff_t len); 2036 loff_t len);
2037extern long do_sys_open(int dfd, const char __user *filename, int flags, 2037extern long do_sys_open(int dfd, const char __user *filename, int flags,
2038 umode_t mode); 2038 umode_t mode);
diff --git a/mm/madvise.c b/mm/madvise.c
index 0938b30da4ab..a271adc93289 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -326,7 +326,7 @@ static long madvise_remove(struct vm_area_struct *vma,
326 */ 326 */
327 get_file(f); 327 get_file(f);
328 up_read(&current->mm->mmap_sem); 328 up_read(&current->mm->mmap_sem);
329 error = do_fallocate(f, 329 error = vfs_fallocate(f,
330 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 330 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
331 offset, end - start); 331 offset, end - start);
332 fput(f); 332 fput(f);