From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>,
Xiubo Li <xiubli@redhat.com>, Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH] ceph: mark lock variable __maybe_unused in ceph_count_file_locks
Date: Tue, 06 Feb 2024 09:52:49 -0500 [thread overview]
Message-ID: <20240206-flsplit-v1-1-17497d0c1e14@kernel.org> (raw)
The "lock" variable won't be used if CONFIG_FILE_LOCKING=n. We can't
remove it altogether though, since we do need it for the
for_each_file_lock loops. Reduce its scope and mark it __maybe_unused.
Fixes: 3956f35fbd36 ("ceph: adapt to breakup of struct file_lock")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402062210.3YyBVGF1-lkp@intel.com/
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
This warning is fallout from the big file_lock re-org, so this should
probably go in via Christian's tree.
---
fs/ceph/locks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index ebf4ac0055dd..edfbf94f0d14 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -377,7 +377,6 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
{
struct ceph_client *cl = ceph_inode_to_client(inode);
- struct file_lock *lock;
struct file_lock_context *ctx;
*fcntl_count = 0;
@@ -385,6 +384,8 @@ void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
ctx = locks_inode_context(inode);
if (ctx) {
+ struct file_lock __maybe_unused *lock;
+
spin_lock(&ctx->flc_lock);
for_each_file_lock(lock, &ctx->flc_posix)
++(*fcntl_count);
---
base-commit: 77f8316a9199a752ffcd136bd01d0566f54e0ea9
change-id: 20240206-flsplit-d4f427d9e0ad
Best regards,
--
Jeff Layton <jlayton@kernel.org>
next reply other threads:[~2024-02-06 14:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 14:52 Jeff Layton [this message]
2024-02-06 15:08 ` [PATCH] ceph: mark lock variable __maybe_unused in ceph_count_file_locks Jeff Layton
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=20240206-flsplit-v1-1-17497d0c1e14@kernel.org \
--to=jlayton@kernel.org \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=xiubli@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.