Why is O_DIRECT checking deferred?
Andrea, Al,
I'm implementing O_DIRECT for our network filesystem, Lustre. One strange thing I noticed is that we do not check for a_ops->direct_IO until deep in the read/write path instead of failing at open time.
Since not many filesystem implement O_DIRECT I was going to submit a patch to generic_direct_IO() which printk's an error if a_ops->direct_IO is not available, but it would really be better to do this at open time before allocating the kiobuf.
Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/
Quoted 9 lines · Andreas Dilger
Andrea, Al,
I'm implementingO_DIRECTfor our network filesystem, Lustre. One strange thing I noticed is that we do not check fora_ops->direct_IOuntil deep in the read/write path instead of failing at open time.Since not many filesystem implement
O_DIRECTI was going to submit a patch togeneric_direct_IO()which printk's an error ifa_ops->direct_IOis not available, but it would really be better to do this at open time before allocating the kiobuf.
This patch moves the check at open time:
http://www.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.19pre10aa4/00_o_direct-open-check-1
Andrea