mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 02:36:21 +00:00
vfs: export remap and write check helpers
Export these functions so that the next patch can use them to check the file ranges being passed to the XFS_IOC_EXCHANGE_RANGE operation. Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
15f78aa3eb
commit
5b9932f600
@ -1667,6 +1667,7 @@ int generic_write_check_limits(struct file *file, loff_t pos, loff_t *count)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(generic_write_check_limits);
|
||||||
|
|
||||||
/* Like generic_write_checks(), but takes size of write instead of iter. */
|
/* Like generic_write_checks(), but takes size of write instead of iter. */
|
||||||
int generic_write_checks_count(struct kiocb *iocb, loff_t *count)
|
int generic_write_checks_count(struct kiocb *iocb, loff_t *count)
|
||||||
|
@ -99,8 +99,7 @@ static int generic_remap_checks(struct file *file_in, loff_t pos_in,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
|
int remap_verify_area(struct file *file, loff_t pos, loff_t len, bool write)
|
||||||
bool write)
|
|
||||||
{
|
{
|
||||||
int mask = write ? MAY_WRITE : MAY_READ;
|
int mask = write ? MAY_WRITE : MAY_READ;
|
||||||
loff_t tmp;
|
loff_t tmp;
|
||||||
@ -118,6 +117,7 @@ static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
|
|||||||
|
|
||||||
return fsnotify_file_area_perm(file, mask, &pos, len);
|
return fsnotify_file_area_perm(file, mask, &pos, len);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(remap_verify_area);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ensure that we don't remap a partial EOF block in the middle of something
|
* Ensure that we don't remap a partial EOF block in the middle of something
|
||||||
|
@ -2119,6 +2119,7 @@ extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
|
|||||||
extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
|
extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
|
||||||
extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
|
extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
|
||||||
loff_t, size_t, unsigned int);
|
loff_t, size_t, unsigned int);
|
||||||
|
int remap_verify_area(struct file *file, loff_t pos, loff_t len, bool write);
|
||||||
int __generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
|
int __generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
|
||||||
struct file *file_out, loff_t pos_out,
|
struct file *file_out, loff_t pos_out,
|
||||||
loff_t *len, unsigned int remap_flags,
|
loff_t *len, unsigned int remap_flags,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user