Re: [PATCH 3/3] btrfs-progs: Create uuid tree with proper contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 27, 2018 at 07:28:40PM +0800, Su Yue wrote:
> > +}
> > +
> > +int create_uuid_tree(struct btrfs_trans_handle *trans)
> > +{
> > +	struct btrfs_fs_info *fs_info = trans->fs_info;
> > +	struct btrfs_root *uuid_root = fs_info->uuid_root;
> > +	struct btrfs_key key;
> > +	int ret;
> > +
> > +	if (!uuid_root) {
> > +		ret = create_empty_tree(trans, BTRFS_UUID_TREE_OBJECTID);
> > +		if (ret < 0) {
> > +			errno = -ret;
> > +			error("failed to create uuid root: %m");
> 
> In personal taste, I don't like such assignment.
> Let the community say.

Check eg. 251d32ea5cd1cf74cb52, replaces strerror(errno) with %m and
requires no change. As we're using strerror(-ret) in many places, it's a
followup that needs the extra errno assignment. This is IMO a small cost
on the source code size and the gain in space savings might be
noticeable for embedded devices, but we need to do all the conversions.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux