From: Tom Rix Date: Tue, 2 May 2023 14:51:29 +0000 (-0400) Subject: btrfs: simplify transid initialization in btrfs_ioctl_wait_sync X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=12df6a622ed8f0cd14470c6d76fe1b85f621f230;p=linux.git btrfs: simplify transid initialization in btrfs_ioctl_wait_sync A small code simplification, move the default value of transid to its initialization and remove the else-statement. Signed-off-by: Tom Rix Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9522669000a77..df7603c306862 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3133,14 +3133,13 @@ out: static noinline long btrfs_ioctl_wait_sync(struct btrfs_fs_info *fs_info, void __user *argp) { - u64 transid; + /* By default wait for the current transaction. */ + u64 transid = 0; - if (argp) { + if (argp) if (copy_from_user(&transid, argp, sizeof(transid))) return -EFAULT; - } else { - transid = 0; /* current trans */ - } + return btrfs_wait_for_commit(fs_info, transid); }