Commit 12df6a62 authored by Tom Rix's avatar Tom Rix Committed by David Sterba

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: default avatarTom Rix <trix@redhat.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b9a9a850
...@@ -3133,14 +3133,13 @@ static noinline long btrfs_ioctl_start_sync(struct btrfs_root *root, ...@@ -3133,14 +3133,13 @@ static noinline long btrfs_ioctl_start_sync(struct btrfs_root *root,
static noinline long btrfs_ioctl_wait_sync(struct btrfs_fs_info *fs_info, static noinline long btrfs_ioctl_wait_sync(struct btrfs_fs_info *fs_info,
void __user *argp) 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))) if (copy_from_user(&transid, argp, sizeof(transid)))
return -EFAULT; return -EFAULT;
} else {
transid = 0; /* current trans */
}
return btrfs_wait_for_commit(fs_info, transid); return btrfs_wait_for_commit(fs_info, transid);
} }
......
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