O_DIRECT Inside Kernel Module?
- From: "jaylucasaustin.rr.com" <jaylucas@xxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 00:14:00 GMT
I have written a target mode SCSI device driver that can use system memory
for high speed reads and writes. I would like to be able to back these
reads and writes up to a partition (I.E. to /dev/sdb1). I have been able to
do so inside the module by opening the specified device and then I can
simply read and write to it. However, standard reads and writes are cached
and not immediately written to the hard drive and really spike CPU
utilization. O_DIRECT has served me in the past as a way to read or write
directly to a block level device, but I am getting an EFAULT (error 14 aka
Bad Address) when I attempt this from a kernel module. I have verified that
my I/O size is sector size and that my I/O's are aligned and a multiple of
sector size, so this is not the problem. Also, I used the same code in user
space and could read and write without incident.
Does anyone know why this might be happening, or any possible workarounds
for such a task?
Thanks,
-Jay
.
- Follow-Ups:
- Re: O_DIRECT Inside Kernel Module?
- From: Peter T. Breuer
- Re: O_DIRECT Inside Kernel Module?
- Prev by Date: Re: What is max cpu's for x86 in stock 2.6 kernel
- Next by Date: Re: What is max cpu's for x86 in stock 2.6 kernel
- Previous by thread: What is max cpu's for x86 in stock 2.6 kernel
- Next by thread: Re: O_DIRECT Inside Kernel Module?
- Index(es):