Re: O_DIRECT

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

 



Thank you very much Hubert.

Regarding my second question, what I mean is, to calculate the soft block size of a partition on which there is no filesystem created, I am using the IOCTL "BLKBSZGET".

int soft_blk_size;
int dev=open("/dev/sda11", O_RDWR | O_DIRECT);
ioctl(dev, BLKBSZGET, &soft_blk_size);
printf ("SOFT BLOCK SIZE=%d\n", soft_blk_size);

Thanking You
Shesha

bert hubert wrote:
On Tue, Jul 20, 2004 at 10:27:57AM -0700, Shesha Sreenivasamurthy wrote:
  
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.
    

As fas as I know, yes, but be aware that O_DIRECT requires page aligned
addresses! (an integral of 4096 on most systems).

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

No idea what you mean - but see above about the aligned addresses.

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

I see no reason why not. Good luck!

  

[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