Re: [PATCH 0/2] iomap: Waiting for IO in iomap_dio_rw()

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

 



On Thu, Oct 10, 2019 at 10:02:27AM +1100, Dave Chinner wrote:
> That would mean the callers need to do something like this by
> default:
> 
> 	ret = iomap_dio_rw(iocb, iter, ops, dops, is_sync_kiocb(iocb));
> 
> And filesystems like XFS will need to do:
> 
> 	ret = iomap_dio_rw(iocb, iter, ops, dops,
> 			is_sync_kiocb(iocb) || unaligned);
> 
> and ext4 will calculate the parameter in whatever way it needs to.

I defintively like that.

> 
> In fact, it may be that a wrapper function is better for existing
> callers:
> 
> static inline ssize_t iomap_dio_rw()
> {
> 	return iomap_dio_rw_wait(iocb, iter, ops, dops, is_sync_kiocb(iocb));
> }
> 
> And XFS/ext4 writes call iomap_dio_rw_wait() directly. That way we
> don't need to change the read code at all...

I have to say I really hated the way we were growing all these wrappers
in the old direct I/O code, so I've been asked Jan to not add the
wrapper in his old version.  But compared to the force_sync version it
at least makes a little more sense here.  I'm just not sure if
iomap_dio_rw_wait is the right name, but the __-prefix convention for
non-trivial differences also sucks.  I can't think of a better name,
though.



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux