bool readonly,
struct btrfs_qgroup_inherit *inherit)
{
- int ret = 0;
+ int ret;
struct qstr qname = QSTR_INIT(name, strlen(name));
if (!S_ISDIR(file_inode(file)->i_mode))
ret = mnt_want_write_file(file);
if (ret)
- goto out;
+ return ret;
if (strchr(name, '/')) {
ret = -EINVAL;
}
out_drop_write:
mnt_drop_write_file(file);
-out:
return ret;
}
struct btrfs_trans_handle *trans;
u64 root_flags;
u64 flags;
- int ret = 0;
+ int ret;
if (!inode_owner_or_capable(file_mnt_idmap(file), inode))
return -EPERM;
ret = mnt_want_write_file(file);
if (ret)
- goto out;
+ return ret;
if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) {
ret = -EINVAL;
up_write(&fs_info->subvol_sem);
out_drop_write:
mnt_drop_write_file(file);
-out:
return ret;
}
continue;
if (sizeof(sh) + item_len > *buf_size) {
- if (*num_found) {
- ret = 1;
- goto out;
- }
+ if (*num_found)
+ return 1;
/*
* return one empty item back for v1, which does not
ret = -EOVERFLOW;
}
- if (sizeof(sh) + item_len + *sk_offset > *buf_size) {
- ret = 1;
- goto out;
- }
+ if (sizeof(sh) + item_len + *sk_offset > *buf_size)
+ return 1;
sh.objectid = key->objectid;
sh.type = key->type;
* problem. Otherwise we'll fault and then copy the buffer in
* properly this next time through
*/
- if (copy_to_user_nofault(ubuf + *sk_offset, &sh, sizeof(sh))) {
- ret = 0;
- goto out;
- }
+ if (copy_to_user_nofault(ubuf + *sk_offset, &sh, sizeof(sh)))
+ return 0;
*sk_offset += sizeof(sh);
*/
if (read_extent_buffer_to_user_nofault(leaf, up,
item_off, item_len)) {
- ret = 0;
*sk_offset -= sizeof(sh);
- goto out;
+ return 0;
}
*sk_offset += item_len;
}
(*num_found)++;
- if (ret) /* -EOVERFLOW from above */
- goto out;
+ /* -EOVERFLOW from above. */
+ if (ret)
+ return ret;
- if (*num_found >= sk->nr_items) {
- ret = 1;
- goto out;
- }
+ if (*num_found >= sk->nr_items)
+ return 1;
}
advance_key:
ret = 0;
key->objectid++;
} else
ret = 1;
-out:
+
/*
* 0: all items from this leaf copied, continue with next
* 1: * more items can be copied, but unused buffer is too small