virtiofsd: passthrough_ll: cleanup getxattr/listxattr
commit16e15a73089102c3d8846792d514e769300fcc3c
authorMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Thu, 27 Feb 2020 05:59:26 +0000 (27 14:59 +0900)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 3 Mar 2020 15:13:24 +0000 (3 15:13 +0000)
treec5349ad4f26940a69e86bb23385ba40abc3ce9e4
parent104933c4a973960dea605b06fcd5d0d478255d77
virtiofsd: passthrough_ll: cleanup getxattr/listxattr

This is a cleanup patch to simplify the following xattr fix and
there is no functional changes.

- Move memory allocation to head of the function
- Unify fgetxattr/flistxattr call for both size == 0 and
  size != 0 case
- Remove redundant lo_inode_put call in error path
  (Note: second call is ignored now since @inode is already NULL)

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Message-Id: <20200227055927.24566-2-misono.tomohiro@jp.fujitsu.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/passthrough_ll.c