@@ -306,7 +306,7 @@ static void nvmet_file_execute_discard(struct nvmet_req *req)
break;
}
- ret = vfs_fallocate(req->ns->file, mode, offset, len);
+ ret = vfs_fallocate(req->ns->file, mode, offset, len, (u64)-1);
if (ret && ret != -EOPNOTSUPP) {
req->error_slba = le64_to_cpu(range.slba);
status = errno_to_nvme_status(req, ret);
@@ -360,7 +360,7 @@ static void nvmet_file_write_zeroes_work(struct work_struct *w)
return;
}
- ret = vfs_fallocate(req->ns->file, mode, offset, len);
+ ret = vfs_fallocate(req->ns->file, mode, offset, len, (u64)-1);
nvmet_req_complete(req, ret < 0 ? errno_to_nvme_status(req, ret) : 0);
}
@@ -2512,7 +2512,7 @@ static void io_fallocate_finish(struct io_wq_work **workptr)
return;
ret = vfs_fallocate(req->file, req->sync.mode, req->sync.off,
- req->sync.len);
+ req->sync.len, (u64)-1);
if (ret < 0)
req_set_fail_links(req);
io_cqring_add_event(req, ret);
@@ -502,7 +502,7 @@ static int ioctl_preallocate(struct file *filp, int mode, void __user *argp)
}
return vfs_fallocate(filp, mode | FALLOC_FL_KEEP_SIZE, sr.l_start,
- sr.l_len);
+ sr.l_len, (u64)-1);
}
/* on ia32 l_start is on a 32-bit boundary */
@@ -530,7 +530,8 @@ static int compat_ioctl_preallocate(struct file *file, int mode,
return -EINVAL;
}
- return vfs_fallocate(file, mode | FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
+ return vfs_fallocate(file, mode | FALLOC_FL_KEEP_SIZE,
+ sr.l_start, sr.l_len, (u64)-1);
}
#endif
@@ -590,7 +590,7 @@ __be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp,
if (!S_ISREG(file_inode(file)->i_mode))
return nfserr_inval;
- error = vfs_fallocate(file, flags, offset, len);
+ error = vfs_fallocate(file, flags, offset, len, (u64)-1);
if (!error)
error = commit_metadata(fhp);
@@ -226,7 +226,8 @@ SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
#endif /* BITS_PER_LONG == 32 */
-int vfs_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, u64 physical)
{
struct inode *inode = file_inode(file);
long ret;
@@ -306,7 +307,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
return -EOPNOTSUPP;
file_start_write(file);
- ret = file->f_op->fallocate(file, mode, offset, len, (u64)-1);
+ ret = file->f_op->fallocate(file, mode, offset, len, physical);
/*
* Create inotify and fanotify events.
@@ -329,7 +330,7 @@ int ksys_fallocate(int fd, int mode, loff_t offset, loff_t len)
int error = -EBADF;
if (f.file) {
- error = vfs_fallocate(f.file, mode, offset, len);
+ error = vfs_fallocate(f.file, mode, offset, len, (u64)-1);
fdput(f);
}
return error;
@@ -476,7 +476,7 @@ static long ovl_fallocate(struct file *file, int mode,
return ret;
old_cred = ovl_override_creds(file_inode(file)->i_sb);
- ret = vfs_fallocate(real.file, mode, offset, len);
+ ret = vfs_fallocate(real.file, mode, offset, len, (u64)-1);
revert_creds(old_cred);
/* Update size */
@@ -2538,7 +2538,7 @@ extern long vfs_truncate(const struct path *, loff_t);
extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
struct file *filp);
extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
- loff_t len);
+ loff_t len, u64 physical);
extern long do_sys_open(int dfd, const char __user *filename, int flags,
umode_t mode);
extern struct file *file_open_name(struct filename *, int, umode_t);
@@ -849,7 +849,7 @@ static long madvise_remove(struct vm_area_struct *vma,
}
error = vfs_fallocate(f,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- offset, end - start);
+ offset, end - start, (u64)-1);
fput(f);
down_read(¤t->mm->mmap_sem);
return error;
This patch propagates @physical into vfs_fallocate(). No functional changes. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> --- drivers/nvme/target/io-cmd-file.c | 4 ++-- fs/io_uring.c | 2 +- fs/ioctl.c | 5 +++-- fs/nfsd/vfs.c | 2 +- fs/open.c | 7 ++++--- fs/overlayfs/file.c | 2 +- include/linux/fs.h | 2 +- mm/madvise.c | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-)