All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/5] Misc props.c cleanups
Date: Fri, 8 Feb 2019 15:31:21 +0800	[thread overview]
Message-ID: <bdcbdf67-d2eb-b5bc-06d1-d26f8fe1f7f9@oracle.com> (raw)
In-Reply-To: <b8e25617-15ff-0a5e-7d9d-d2ad7e070887@suse.com>



On 2/8/19 3:15 PM, Nikolay Borisov wrote:
> 
> 
> On 8.02.19 г. 9:02 ч., Anand Jain wrote:
>> While adding the readmirror property found few cleanup things which
>> can be fixed. As these aren't part of upcoming readmirror property
>> I am sending these separately. Except for 1/5 rest fixes are in
>> props.c. 1/5 is in volume.c.
>>
>> Anand Jain (5):
>>    btrfs: fix comment its device list mutex not volume lock
>>    btrfs: kill __btrfs_set_prop()
>>    btrfs: reorg functions to drop forward declaration
>>    btrfs: drop redundant forward declaration in props.c
>>    btrfs: trivial, fix c coding style
>>
>>   fs/btrfs/ioctl.c   |  10 +--
>>   fs/btrfs/props.c   | 201 ++++++++++++++++++++++++-----------------------------
>>   fs/btrfs/props.h   |   6 +-
>>   fs/btrfs/volumes.c |   2 +-
>>   fs/btrfs/xattr.c   |   2 +-
>>   5 files changed, 100 insertions(+), 121 deletions(-)
>>
> 
> Allow me to suggest to introduce another patch with the following hunk:
> 
> diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
> index ea78c3d6dcfc..37e9af2a9f8c 100644
> --- a/fs/btrfs/xattr.c
> +++ b/fs/btrfs/xattr.c
> @@ -229,12 +229,11 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans,
>          if (btrfs_root_readonly(root))
>                  return -EROFS;
> 
> -       if (trans)
> -               return do_setxattr(trans, inode, name, value, size, flags);
> -
> -       trans = btrfs_start_transaction(root, 2);
> -       if (IS_ERR(trans))
> -               return PTR_ERR(trans);
> +       if (!trans) {
> +               trans = btrfs_start_transaction(root, 2);
> +               if (IS_ERR(trans))
> +                       return PTR_ERR(trans);
> +       }
> 
>          ret = do_setxattr(trans, inode, name, value, size, flags);
>          if (ret)
> 
> 
> This just inverts the logic for !trans and makes the code a bit more
> linear and (IMO) easier to follow.
> 


Thanks for the comments.

But we still have to break the linear flow for the case of
  trans != NULL. Where we don't do the
    inode_inc_iversion(inode);
and the rest part.

-Anand



      reply	other threads:[~2019-02-08  7:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  7:02 [PATCH 0/5] Misc props.c cleanups Anand Jain
2019-02-08  7:02 ` [PATCH 1/5] btrfs: fix comment its device list mutex not volume lock Anand Jain
2019-02-08  7:07   ` Nikolay Borisov
2019-02-08  7:16     ` Anand Jain
2019-02-08  7:19       ` Nikolay Borisov
2019-02-08  7:39         ` [PATCH v2 " Anand Jain
2019-02-11 18:41           ` David Sterba
2019-02-08  7:02 ` [PATCH 2/5] btrfs: kill __btrfs_set_prop() Anand Jain
2019-02-08  7:02 ` [PATCH 3/5] btrfs: reorg functions to drop forward declaration Anand Jain
2019-02-08  7:10   ` Nikolay Borisov
2019-02-11 18:43     ` David Sterba
2019-02-08  7:02 ` [PATCH 4/5] btrfs: drop redundant forward declaration in props.c Anand Jain
2019-02-08  7:09   ` Nikolay Borisov
2019-02-08  7:02 ` [PATCH 5/5] btrfs: trivial, fix c coding style Anand Jain
2019-02-08  7:09   ` Nikolay Borisov
2019-02-08  7:15 ` [PATCH 0/5] Misc props.c cleanups Nikolay Borisov
2019-02-08  7:31   ` Anand Jain [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bdcbdf67-d2eb-b5bc-06d1-d26f8fe1f7f9@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.