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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 29, 2024 at 01:11:11PM +1000, Dave Chinner wrote:
> > +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@xxxxxxxxxxxxx
---end quoted text---




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux