Thread (25 messages) 25 messages, 5 authors, 2024-08-29

Re: [PATCH 6/6] xfs: refactor xfs_file_fallocate

From: Christoph Hellwig <hch@lst.de>
Date: 2024-08-29 03:56:31
Also in: linux-ext4, linux-fsdevel, linux-xfs

On Thu, Aug 29, 2024 at 01:11:11PM +1000, Dave Chinner wrote:
quoted
+xfs_falloc_allocate_range(
+	struct file		*file,
+	int			mode,
+	loff_t			offset,
+	loff_t			len)
+{
+	struct inode		*inode = file_inode(file);
+	loff_t			new_size = 0;
+	int			error;
+
+	/*
+	 * If always_cow mode we can't use preallocations and thus should not
+	 * create them.
+	 */
+	if (xfs_is_always_cow_inode(XFS_I(inode)))
+		return -EOPNOTSUPP;
... our preallocation operation always returns -EOPNOTSUPP for
COW mode.

Should the zeroing code also have this COW mode check in it after
the hole punch has run so we don't do unnecessary prealloc there?
The low-level block allocation helper just returns early without
doing work (move a bit, but not changed in behavior earlier in the
series).  So it won't actually do the prealloc.
-Dave.
-- 
Dave Chinner
david@fromorbit.com
---end quoted text---
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help