Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[deliverable/linux.git] / fs / btrfs / inode-map.c
index 8b57c17b3fb3194bfff6ae1e487fe0fa7a4fa887..1f0ec19b23f615faae7a6ba81b6b203657ae4d23 100644 (file)
@@ -515,7 +515,7 @@ out:
        return ret;
 }
 
-static int btrfs_find_highest_objectid(struct btrfs_root *root, u64 *objectid)
+int btrfs_find_highest_objectid(struct btrfs_root *root, u64 *objectid)
 {
        struct btrfs_path *path;
        int ret;
@@ -555,14 +555,10 @@ int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid)
        int ret;
        mutex_lock(&root->objectid_mutex);
 
-       if (unlikely(root->highest_objectid < BTRFS_FIRST_FREE_OBJECTID)) {
-               ret = btrfs_find_highest_objectid(root,
-                                                 &root->highest_objectid);
-               if (ret)
-                       goto out;
-       }
-
        if (unlikely(root->highest_objectid >= BTRFS_LAST_FREE_OBJECTID)) {
+               btrfs_warn(root->fs_info,
+                          "the objectid of root %llu reaches its highest value",
+                          root->root_key.objectid);
                ret = -ENOSPC;
                goto out;
        }
This page took 0.024959 seconds and 5 git commands to generate.