]> git.karo-electronics.de Git - linux-beck.git/commitdiff
btrfs: fix warnings after changes in btrfs_abort_transaction
authorDavid Sterba <dsterba@suse.cz>
Fri, 24 Apr 2015 17:12:01 +0000 (19:12 +0200)
committerChris Mason <clm@fb.com>
Wed, 3 Jun 2015 02:34:34 +0000 (19:34 -0700)
fs/btrfs/volumes.c: In function ‘btrfs_create_uuid_tree’:
fs/btrfs/volumes.c:3909:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
   btrfs_abort_transaction(trans, tree_root,
   ^
  CC [M]  fs/btrfs/ioctl.o
fs/btrfs/ioctl.c: In function ‘create_subvol’:
fs/btrfs/ioctl.c:549:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
   btrfs_abort_transaction(trans, root, PTR_ERR(new_root));

PTR_ERR returns long, but we're really using 'int' for the error codes
everywhere so just set and use the local variable.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ioctl.c
fs/btrfs/volumes.c

index 6f790bcddfc1c58d97618580956598c651f9605f..f77f6b3d24b9db7e30297db291058002ed73354e 100644 (file)
@@ -553,8 +553,8 @@ static noinline int create_subvol(struct inode *dir,
        key.offset = (u64)-1;
        new_root = btrfs_read_fs_root_no_name(root->fs_info, &key);
        if (IS_ERR(new_root)) {
-               btrfs_abort_transaction(trans, root, PTR_ERR(new_root));
                ret = PTR_ERR(new_root);
+               btrfs_abort_transaction(trans, root, ret);
                goto fail;
        }
 
index d0582b7854856f0f2e71126ad3cc49fb5b102e7d..1fcbd93ca0ec365c3b7097102c1dd4f588e065b8 100644 (file)
@@ -3908,9 +3908,9 @@ int btrfs_create_uuid_tree(struct btrfs_fs_info *fs_info)
        uuid_root = btrfs_create_tree(trans, fs_info,
                                      BTRFS_UUID_TREE_OBJECTID);
        if (IS_ERR(uuid_root)) {
-               btrfs_abort_transaction(trans, tree_root,
-                                       PTR_ERR(uuid_root));
-               return PTR_ERR(uuid_root);
+               ret = PTR_ERR(uuid_root);
+               btrfs_abort_transaction(trans, tree_root, ret);
+               return ret;
        }
 
        fs_info->uuid_root = uuid_root;