Re: O_DIRECT

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

 



On Tue, 20 Jul 2004 10:27:57 -0700
Shesha Sreenivasamurthy <shesha@xxxxxxxxxxx> wrote:

Hi Shesha,

> I am having trouble with O_DIRECT. Trying to read or write from a block 
> device partition.
> 
> 1. Can O_DIRECT be used on a plain block device partition say 
> "/dev/sda11" without having a filesystem on it.

yes.

> 2. If no file system is created then what should be the softblock size. 
> I am using the IOCTL "BLKBSZGET". Is this correct?

yes.

> 3. Can we use SEEK_END with O_DIRECT on a partition without filesystem.

yes.

I'm using these exact things in an application.

Note that with 2.4 kernels the "granularity" you can use for offset
and r/w size is the softblock size (*).  For 2.6 the requirements are
much more relaxed: it's the device blocksize (typically 512 byte).

(*): actually one of offset or r/w size has a smaller minimum if
I remember correctly.  Don't remember which one.  But if you assume
the softblock size as a minimum for both you're allways safe.

	greetings,
	Rob van Nieuwkerk

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux