diff options
-rw-r--r-- | fs/xfs/xfs_inode.c | 10 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.h | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 89e6441f963f..3332fb695cfd 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -80,7 +80,8 @@ xfs_get_extsz_hint( | |||
80 | /* | 80 | /* |
81 | * Helper function to extract CoW extent size hint from inode. | 81 | * Helper function to extract CoW extent size hint from inode. |
82 | * Between the extent size hint and the CoW extent size hint, we | 82 | * Between the extent size hint and the CoW extent size hint, we |
83 | * return the greater of the two. | 83 | * return the greater of the two. If the value is zero (automatic), |
84 | * use the default size. | ||
84 | */ | 85 | */ |
85 | xfs_extlen_t | 86 | xfs_extlen_t |
86 | xfs_get_cowextsz_hint( | 87 | xfs_get_cowextsz_hint( |
@@ -93,9 +94,10 @@ xfs_get_cowextsz_hint( | |||
93 | a = ip->i_d.di_cowextsize; | 94 | a = ip->i_d.di_cowextsize; |
94 | b = xfs_get_extsz_hint(ip); | 95 | b = xfs_get_extsz_hint(ip); |
95 | 96 | ||
96 | if (a > b) | 97 | a = max(a, b); |
97 | return a; | 98 | if (a == 0) |
98 | return b; | 99 | return XFS_DEFAULT_COWEXTSZ_HINT; |
100 | return a; | ||
99 | } | 101 | } |
100 | 102 | ||
101 | /* | 103 | /* |
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 6d63dc031127..f14c1de2549d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -490,4 +490,7 @@ do { \ | |||
490 | 490 | ||
491 | extern struct kmem_zone *xfs_inode_zone; | 491 | extern struct kmem_zone *xfs_inode_zone; |
492 | 492 | ||
493 | /* The default CoW extent size hint. */ | ||
494 | #define XFS_DEFAULT_COWEXTSZ_HINT 32 | ||
495 | |||
493 | #endif /* __XFS_INODE_H__ */ | 496 | #endif /* __XFS_INODE_H__ */ |