linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH 11/13] target: Pass a NULL pointer to kernel_write
Date: Sat,  3 Oct 2020 03:55:32 +0100	[thread overview]
Message-ID: <20201003025534.21045-12-willy@infradead.org> (raw)
In-Reply-To: <20201003025534.21045-1-willy@infradead.org>

We want to start at 0 and do not care about the updated value.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 drivers/target/target_core_alua.c | 3 +--
 drivers/target/target_core_pr.c   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index 6b72afee2f8b..98b702e50961 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -883,14 +883,13 @@ 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, &pos);
+	ret = kernel_write(file, md_buf, md_buf_len, NULL);
 	if (ret < 0)
 		pr_err("Error writing ALUA metadata file: %s\n", path);
 	fput(file);
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 8fc88654bff6..6fb9940e2e02 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -1976,7 +1976,6 @@ static int __core_scsi3_write_aptpl_to_file(
 	char *path;
 	u32 pr_aptpl_buf_len;
 	int ret;
-	loff_t pos = 0;
 
 	path = kasprintf(GFP_KERNEL, "%s/pr/aptpl_%s", db_root,
 			&wwn->unit_serial[0]);
@@ -1993,7 +1992,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, &pos);
+	ret = kernel_write(file, buf, pr_aptpl_buf_len, NULL);
 
 	if (ret < 0)
 		pr_debug("Error writing APTPL metadata file: %s\n", path);
-- 
2.28.0


  parent reply	other threads:[~2020-10-03  2:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03  2:55 [PATCH 00/13] Clean up kernel_read/kernel_write Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 01/13] fs: Allow a NULL pos pointer to __kernel_write Matthew Wilcox (Oracle)
2020-10-15 17:56   ` Christoph Hellwig
2020-10-03  2:55 ` [PATCH 02/13] fs: Allow a NULL pos pointer to __kernel_read Matthew Wilcox (Oracle)
2020-10-15 17:56   ` Christoph Hellwig
2020-10-03  2:55 ` [PATCH 03/13] fs/acct: Pass a NULL pointer to __kernel_write Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 04/13] um/mconsole: Pass a NULL pointer to kernel_read Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 05/13] x86/aout: " Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 06/13] aout: " Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 07/13] binfmt_flat: " Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 08/13] exec: " Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 09/13] bpfilter: Pass a NULL pointer to kernel_read and kernel_write Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 10/13] keys: " Matthew Wilcox (Oracle)
2020-10-03  2:55 ` Matthew Wilcox (Oracle) [this message]
2020-10-03  2:55 ` [PATCH 12/13] proc: Pass a NULL pointer to kernel_write Matthew Wilcox (Oracle)
2020-10-03  2:55 ` [PATCH 13/13] usermode: " Matthew Wilcox (Oracle)
2020-10-03  3:47 ` [PATCH 00/13] Clean up kernel_read/kernel_write Al Viro
2020-10-09 22:07   ` Eric Biggers
2020-10-15 17:56 ` Christoph Hellwig
2020-10-15 18:23   ` 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=20201003025534.21045-12-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).