Commit 6c2c1e00 authored by David Howells's avatar David Howells

9p: Do a couple of cleanups

Do a couple of cleanups to 9p:

 (1) Remove a couple of unused variables.

 (2) Turn a BUG_ON() into a warning, consolidate with another warning and
     make the warning message include the inode number rather than
     whatever's in i_private (which will get hashed anyway).
Suggested-by: default avatarDominique Martinet <asmadeus@codewreck.org>
Link: https://lore.kernel.org/r/ZZULNQAZ0n0WQv7p@codewreck.org/Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarDominique Martinet <asmadeus@codewreck.org>
cc: Eric Van Hensbergen <ericvh@kernel.org>
cc: Latchesar Ionkov <lucho@ionkov.net>
cc: Christian Schoenebeck <linux_oss@crudebyte.com>
cc: v9fs@lists.linux.dev
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
parent 9546ac78
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
static void v9fs_upload_to_server(struct netfs_io_subrequest *subreq) static void v9fs_upload_to_server(struct netfs_io_subrequest *subreq)
{ {
struct inode *inode = subreq->rreq->inode;
struct v9fs_inode __maybe_unused *v9inode = V9FS_I(inode);
struct p9_fid *fid = subreq->rreq->netfs_priv; struct p9_fid *fid = subreq->rreq->netfs_priv;
int err; int err;
...@@ -98,15 +96,13 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file) ...@@ -98,15 +96,13 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)
if (file) { if (file) {
fid = file->private_data; fid = file->private_data;
BUG_ON(!fid); if (!fid)
goto no_fid;
p9_fid_get(fid); p9_fid_get(fid);
} else { } else {
fid = v9fs_fid_find_inode(rreq->inode, writing, INVALID_UID, true); fid = v9fs_fid_find_inode(rreq->inode, writing, INVALID_UID, true);
if (!fid) { if (!fid)
WARN_ONCE(1, "folio expected an open fid inode->i_private=%p\n", goto no_fid;
rreq->inode->i_private);
return -EINVAL;
}
} }
/* we might need to read from a fid that was opened write-only /* we might need to read from a fid that was opened write-only
...@@ -115,6 +111,11 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file) ...@@ -115,6 +111,11 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)
WARN_ON(rreq->origin == NETFS_READ_FOR_WRITE && !(fid->mode & P9_ORDWR)); WARN_ON(rreq->origin == NETFS_READ_FOR_WRITE && !(fid->mode & P9_ORDWR));
rreq->netfs_priv = fid; rreq->netfs_priv = fid;
return 0; return 0;
no_fid:
WARN_ONCE(1, "folio expected an open fid inode->i_ino=%lx\n",
rreq->inode->i_ino);
return -EINVAL;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment