NFSD: Clean up nfsctl_transaction_write()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 15 May 2023 13:35:44 +0000 (09:35 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 5 Jun 2023 13:01:42 +0000 (09:01 -0400)
For easier readability, follow the common convention:

    if (error)
handle_error;
    continue_normally;

No behavior change is expected.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c

index 2ecea3b..df0aae2 100644 (file)
@@ -109,12 +109,12 @@ static ssize_t nfsctl_transaction_write(struct file *file, const char __user *bu
        if (IS_ERR(data))
                return PTR_ERR(data);
 
-       rv =  write_op[ino](file, data, size);
-       if (rv >= 0) {
-               simple_transaction_set(file, rv);
-               rv = size;
-       }
-       return rv;
+       rv = write_op[ino](file, data, size);
+       if (rv < 0)
+               return rv;
+
+       simple_transaction_set(file, rv);
+       return size;
 }
 
 static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size_t size, loff_t *pos)