public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: convert to spinlock guards in btrfs_update_ioctl_balance_args()
@ 2025-04-09 12:57 Yangtao Li
  2025-04-09 12:57 ` [PATCH 2/2] btrfs: convert to mutex guard in btrfs_ioctl_balance_progress() Yangtao Li
  2025-04-09 18:30 ` [PATCH 1/2] btrfs: convert to spinlock guards in btrfs_update_ioctl_balance_args() David Sterba
  0 siblings, 2 replies; 7+ messages in thread
From: Yangtao Li @ 2025-04-09 12:57 UTC (permalink / raw)
  To: clm, josef, dsterba; +Cc: linux-btrfs, linux-kernel, Yangtao Li

To simplify handling, use the guard helper to let the compiler care for
unlocking.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/btrfs/ioctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 63aeacc54945..7cec105a4cb0 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3438,9 +3438,8 @@ void btrfs_update_ioctl_balance_args(struct btrfs_fs_info *fs_info,
 	memcpy(&bargs->meta, &bctl->meta, sizeof(bargs->meta));
 	memcpy(&bargs->sys, &bctl->sys, sizeof(bargs->sys));
 
-	spin_lock(&fs_info->balance_lock);
+	guard(spinlock)(&fs_info->balance_lock);
 	memcpy(&bargs->stat, &bctl->stat, sizeof(bargs->stat));
-	spin_unlock(&fs_info->balance_lock);
 }
 
 /*
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-17 13:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 12:57 [PATCH 1/2] btrfs: convert to spinlock guards in btrfs_update_ioctl_balance_args() Yangtao Li
2025-04-09 12:57 ` [PATCH 2/2] btrfs: convert to mutex guard in btrfs_ioctl_balance_progress() Yangtao Li
2025-04-10 14:45   ` kernel test robot
2025-04-09 18:30 ` [PATCH 1/2] btrfs: convert to spinlock guards in btrfs_update_ioctl_balance_args() David Sterba
2025-04-10 11:11   ` 回复: " 李扬韬
2025-04-15 17:53     ` David Sterba
2025-04-17 13:38       ` 回复: " 李扬韬

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox