This allows you to open a file with O_DIRECT and have reads bypass
the buffer cache (note that O_DIRECT is only visible from kernel headers
at the moment, so some header file futzing is needed to get to it).
This is a very basic implementation which makes no attempt
at synchronization with the buffer cache, it just moves what is on the disk
to user memory directly. User buffer addresses and file offsets should be
sector aligned (512 byte) - not all the checks for this are in place yet.
We could do the cache synchronization part of this by flushing buffers, or
finding them and copying from them to user memory when needed.
Modid: 2.3.99pre2-xfs:slinx:58069a
Date: Sun Apr 16 12:25:12 PDT 2000
Workarea: clink.americas.sgi.com:/data/clink/io/lord/xfs-linux
The following file(s) were checked into:
bonnie.engr.sgi.com:/isms/slinx/2.3.99pre2-xfs
linux/fs/page_buf.c - 1.80
http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.4-xfs/linux/fs/page_buf.c.diff?r1=text&tr1=1.80&r2=text&tr2=1.79&f=h
- Add support for O_DIRECT on reads - this is a basic implementation,
not attempt at cache coherency yet - i.e. if there are dirty buffers
the read will miss them.
linux/fs/page_buf_locking.c - 1.23
http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.4-xfs/linux/fs/page_buf_locking.c.diff?r1=text&tr1=1.23&r2=text&tr2=1.22&f=h
- Remove debug printf
|