Re: Block device API

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

 



On 1/25/06, Joshua Hudson <[email protected]> wrote:
> I am working on a kernel filesystem driver. I have found plenty of
> documentation on
> how to communicate between the VFS and the filesystem driver, but nothing
> on how to communicate between the block device and the filesystem driver.
>

AFAIK there isn't any documentation/article for block and filesystem
layer interaction (or till now me also not able to find any) :)

> I found sb_bread() but there is no corrisponding sb_bwrite().
> I presume that if ((struct superblock *)s) -> bdev is the block
> device handle, but I cannot find the read/write pair of functions.
> -

sb_bread is the function used for reading a block (especially
superblock) from the storage. For reading/writing do look at
generic_file_read/write functions found in mm/filemap.c and when going
through the code you will see its ends up in calling
mappings->a_ops->readpage(s)/writepage(s) of filesystem in which
normal filesystems (like ext2) just call function
mpage_readpages/writepages found in fs/mpage.c which performs actual
read/write on the block device.

I hope this helps !

--
Fawad Lateef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux