]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/btrfs/inode-map.c
Merge tag 'pinctrl-v4.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[mirror_ubuntu-bionic-kernel.git] / fs / btrfs / inode-map.c
index e50316c4af157183d3862fac8e318abe7eb66ecd..70107f7c930730c8054d45c153dec71cf9227270 100644 (file)
@@ -283,7 +283,7 @@ void btrfs_unpin_free_ino(struct btrfs_root *root)
 }
 
 #define INIT_THRESHOLD ((SZ_32K / 2) / sizeof(struct btrfs_free_space))
-#define INODES_PER_BITMAP (PAGE_CACHE_SIZE * 8)
+#define INODES_PER_BITMAP (PAGE_SIZE * 8)
 
 /*
  * The goal is to keep the memory used by the free_ino tree won't
@@ -317,7 +317,7 @@ static void recalculate_thresholds(struct btrfs_free_space_ctl *ctl)
        }
 
        ctl->extents_thresh = (max_bitmaps - ctl->total_bitmaps) *
-                               PAGE_CACHE_SIZE / sizeof(*info);
+                               PAGE_SIZE / sizeof(*info);
 }
 
 /*
@@ -481,12 +481,12 @@ again:
 
        spin_lock(&ctl->tree_lock);
        prealloc = sizeof(struct btrfs_free_space) * ctl->free_extents;
-       prealloc = ALIGN(prealloc, PAGE_CACHE_SIZE);
-       prealloc += ctl->total_bitmaps * PAGE_CACHE_SIZE;
+       prealloc = ALIGN(prealloc, PAGE_SIZE);
+       prealloc += ctl->total_bitmaps * PAGE_SIZE;
        spin_unlock(&ctl->tree_lock);
 
        /* Just to make sure we have enough space */
-       prealloc += 8 * PAGE_CACHE_SIZE;
+       prealloc += 8 * PAGE_SIZE;
 
        ret = btrfs_delalloc_reserve_space(inode, 0, prealloc);
        if (ret)
@@ -556,6 +556,9 @@ int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid)
        mutex_lock(&root->objectid_mutex);
 
        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;
        }