| To: | david@xxxxxxxxxxxxx, darrick.wong@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH 64/71] xfs: set a default CoW extent size of 32 blocks |
| From: | "Darrick J. Wong" <darrick.wong@xxxxxxxxxx> |
| Date: | Thu, 25 Aug 2016 16:38:51 -0700 |
| Cc: | linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <147216791538.867.12413509832420924168.stgit@xxxxxxxxxxxxxxxx> |
| References: | <147216791538.867.12413509832420924168.stgit@xxxxxxxxxxxxxxxx> |
| User-agent: | StGit/0.17.1-dirty |
If the admin doesn't set a CoW extent size or a regular extent size
hint, default to creating CoW reservations 32 blocks long to reduce
fragmentation.
Signed-off-by: DarricK J. Wong <darrick.wong@xxxxxxxxxx>
---
fs/xfs/xfs_inode.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index e91fd84..8c2f9a7 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -80,7 +80,8 @@ xfs_get_extsz_hint(
/*
* Helper function to extract CoW extent size hint from inode.
* Between the extent size hint and the CoW extent size hint, we
- * return the greater of the two.
+ * return the greater of the two. If the value is zero (automatic),
+ * default to 32 blocks.
*/
xfs_extlen_t
xfs_get_cowextsz_hint(
@@ -93,9 +94,10 @@ xfs_get_cowextsz_hint(
a = ip->i_d.di_cowextsize;
b = xfs_get_extsz_hint(ip);
- if (a > b)
- return a;
- return b;
+ a = max(a, b);
+ if (a == 0)
+ return 32;
+ return a;
}
/*
|
| Previous by Date: | [PATCH 63/71] xfs: convert unwritten status of reverse mappings for shared files, Darrick J. Wong |
|---|---|
| Next by Date: | [PATCH 65/71] xfs: check for invalid inode reflink flags, Darrick J. Wong |
| Previous by Thread: | [PATCH 63/71] xfs: convert unwritten status of reverse mappings for shared files, Darrick J. Wong |
| Next by Thread: | [PATCH 65/71] xfs: check for invalid inode reflink flags, Darrick J. Wong |
| Indexes: | [Date] [Thread] [Top] [All Lists] |