Re: [PATCH 6/7] xfs: use iomap_valid method to detect stale cached iomaps

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

 



> +	*((int *)&iomap->private) = sequence;

> +static bool
> +xfs_buffered_write_iomap_valid(
> +	struct inode		*inode,
> +	const struct iomap	*iomap)
> +{
> +	int			seq = *((int *)&iomap->private);

I really hate this stuffing of the sequence into the private pointer.
The iomap structure isn't so size constrained that we have to do that,
so we can just add a sequence number field directly to it.  I don't
think that is a layering violation, as the concept of a sequence
numebr is pretty generic and we'll probably need it for all file systems
eventually.

> +
> +	if (seq != READ_ONCE(XFS_I(inode)->i_df.if_seq))
> +		return false;

Which makes me wonder if we could do away with the callback entirely
by adding an option sequence number pointer to the iomap_iter.  If set
the core code compares it against iomap->seq and we get rid of the
per-folio indirect call, and boilerplate code that would need to be
implemented in every file system.



[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