Skip to contentSkip to conversation

Why is O_DIRECT checking deferred?

DISCUSSION Andreas Dilger 2 participants 2 messages Jun 22, 2002 – Jun 24, 2002 VFS

lore
Share & tools
lore
#0 lore raw

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/

#1 lore raw
Quoted 9 lines · Andreas Dilger

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.

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