lkml.org 
[lkml]   [2008]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 24/45] CacheFiles: Add a hook to write a single page of data to an inode [ver #41]
On Thu, 20 Nov 2008 14:43:43 +0000 David Howells <dhowells@redhat.com> wrote:

> Add an address space operation to write one single page of data to an inode at
> a page-aligned location (thus permitting the implementation to be highly
> optimised). The data source is a single page.
>
> This is used by CacheFiles to store the contents of netfs pages into their
> backing file pages.
>
> Supply a generic implementation for this that uses the write_begin() and
> write_end() address_space operations to bind a copy directly into the page
> cache.
>
> Hook the Ext2 and Ext3 operations to the generic implementation.
>
>
> ...
>
> +
> + /* write the contents of the source page over the page at the specified
> + * index in the target address space (the source page does not need to
> + * be related to the target address space) */
> + int (*write_one_page)(struct address_space *, pgoff_t, struct page *);
> };

Sigh. I don't normally comment on busted comment layout, but Ingo does
so I'm allowed to ;) See recent discussion around the kmemleak patches.

> +/**
> + * generic_file_buffered_write_one_page - Write a single page of data to an
> + * inode

kerneldoc doesn't permit line breaks in this context (unless it got
fixed recently)

> + * @mapping - The address space of the target inode
> + * @index - The target page in the target inode to fill
> + * @source - The data to write into the target page
> + *
> + * Write the data from the source page to the page in the nominated address
> + * space at the @index specified. Note that the file will not be extended if
> + * the page crosses the EOF marker, in which case only the first part of the
> + * page will be written.
> + *
> + * The @source page does not need to have any association with the file or the
> + * target page offset.
> + */



\
 
 \ /
  Last update: 2008-11-21 09:27    [W:0.812 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site