diff options
author | Tom Rix <trix@redhat.com> | 2023-05-02 17:51:29 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-06-19 14:59:23 +0300 |
commit | 12df6a622ed8f0cd14470c6d76fe1b85f621f230 (patch) | |
tree | 0408c308e90b2522c5c1ced7af6908f88c3f75ff /fs/btrfs | |
parent | b9a9a85059cde9bcc66effe0da9f1b6fb342a700 (diff) | |
download | linux-12df6a622ed8f0cd14470c6d76fe1b85f621f230.tar.xz |
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 <trix@redhat.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9522669000a7..df7603c30686 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); } |