fs: fix kernel_write prototype
Make the position an in/out argument like all the other read/write helpers and and make the buf argument a void pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:

committed by
Al Viro

parent
bdd1d2d3d2
commit
e13ec939e9
@@ -896,13 +896,14 @@ static int core_alua_write_tpg_metadata(
|
||||
u32 md_buf_len)
|
||||
{
|
||||
struct file *file = filp_open(path, O_RDWR | O_CREAT | O_TRUNC, 0600);
|
||||
loff_t pos = 0;
|
||||
int ret;
|
||||
|
||||
if (IS_ERR(file)) {
|
||||
pr_err("filp_open(%s) for ALUA metadata failed\n", path);
|
||||
return -ENODEV;
|
||||
}
|
||||
ret = kernel_write(file, md_buf, md_buf_len, 0);
|
||||
ret = kernel_write(file, md_buf, md_buf_len, &pos);
|
||||
if (ret < 0)
|
||||
pr_err("Error writing ALUA metadata file: %s\n", path);
|
||||
fput(file);
|
||||
|
@@ -443,7 +443,7 @@ fd_do_prot_fill(struct se_device *se_dev, sector_t lba, sector_t nolb,
|
||||
|
||||
for (prot = 0; prot < prot_length;) {
|
||||
sector_t len = min_t(sector_t, bufsize, prot_length - prot);
|
||||
ssize_t ret = kernel_write(prot_fd, buf, len, pos + prot);
|
||||
ssize_t ret = kernel_write(prot_fd, buf, len, &pos);
|
||||
|
||||
if (ret != len) {
|
||||
pr_err("vfs_write to prot file failed: %zd\n", ret);
|
||||
|
@@ -1974,6 +1974,7 @@ static int __core_scsi3_write_aptpl_to_file(
|
||||
char path[512];
|
||||
u32 pr_aptpl_buf_len;
|
||||
int ret;
|
||||
loff_t pos = 0;
|
||||
|
||||
memset(path, 0, 512);
|
||||
|
||||
@@ -1993,7 +1994,7 @@ static int __core_scsi3_write_aptpl_to_file(
|
||||
|
||||
pr_aptpl_buf_len = (strlen(buf) + 1); /* Add extra for NULL */
|
||||
|
||||
ret = kernel_write(file, buf, pr_aptpl_buf_len, 0);
|
||||
ret = kernel_write(file, buf, pr_aptpl_buf_len, &pos);
|
||||
|
||||
if (ret < 0)
|
||||
pr_debug("Error writing APTPL metadata file: %s\n", path);
|
||||
|
Reference in New Issue
Block a user