All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coywolf Qi Hunt <coywolf@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: Re: + readahead-commentary.patch added to -mm tree
Date: Thu, 3 Nov 2005 09:58:29 +0800	[thread overview]
Message-ID: <2cd57c900511021758j29ffb5f4l@mail.gmail.com> (raw)
In-Reply-To: <200511030145.jA31j8eB021068@shell0.pdx.osdl.net>

On 03/11/05, akpm@osdl.org <akpm@osdl.org> wrote:
>
> The patch titled
>
>      readahead commentary
>
> has been added to the -mm tree.  Its filename is
>
>      readahead-commentary.patch
>
>
> From: Andrew Morton <akpm@osdl.org>
>
> Add a few comments surrounding thr generic readahead API.
>
> Also convert some ulongs into pgoff_t: the identifier for PAGE_CACHE_SIZE
> offsets into pagecache.
>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
>
>  include/linux/mm.h |    8 ++++----
>  mm/readahead.c     |   31 ++++++++++++++++++++++---------
>  2 files changed, 26 insertions(+), 13 deletions(-)
>
> diff -puN mm/readahead.c~readahead-commentary mm/readahead.c
> --- 25/mm/readahead.c~readahead-commentary      2005-11-03 08:06:16.000000000 +1100
> +++ 25-akpm/mm/readahead.c      2005-11-03 08:16:16.000000000 +1100
> @@ -254,7 +254,7 @@ out:
>   */
>  static int
>  __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
> -                       unsigned long offset, unsigned long nr_to_read)
> +                       pgoff_t offset, unsigned long nr_to_read)
>  {
>         struct inode *inode = mapping->host;
>         struct page *page;
> @@ -274,7 +274,7 @@ __do_page_cache_readahead(struct address
>          */
>         read_lock_irq(&mapping->tree_lock);
>         for (page_idx = 0; page_idx < nr_to_read; page_idx++) {
> -               unsigned long page_offset = offset + page_idx;
> +               pgoff_t page_offset = offset + page_idx;
>
>                 if (page_offset > end_index)
>                         break;
> @@ -311,7 +311,7 @@ out:
>   * memory at once.
>   */
>  int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
> -               unsigned long offset, unsigned long nr_to_read)
> +               pgoff_t offset, unsigned long nr_to_read)
>  {
>         int ret = 0;
>
> @@ -368,7 +368,7 @@ static inline int check_ra_success(struc
>   * request queues.
>   */
>  int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
> -                       unsigned long offset, unsigned long nr_to_read)
> +                       pgoff_t offset, unsigned long nr_to_read)
>  {
>         if (bdi_read_congested(mapping->backing_dev_info))
>                 return -1;
> @@ -385,7 +385,7 @@ int do_page_cache_readahead(struct addre
>   */
>  static int
>  blockable_page_cache_readahead(struct address_space *mapping, struct file *filp,
> -                       unsigned long offset, unsigned long nr_to_read,
> +                       pgoff_t offset, unsigned long nr_to_read,
>                         struct file_ra_state *ra, int block)
>  {
>         int actual;
> @@ -430,14 +430,27 @@ static int make_ahead_window(struct addr
>         return ret;
>  }
>
> -/*
> - * page_cache_readahead is the main function.  If performs the adaptive
> +/**
> + * page_cache_readahead - generic adaptive readahead
> + * @mapping: address_space which holds te pagecache and I/O vectors

typo. s/te/the/

> + * @ra: file_ra_state which holds the readahead state
> + * @filp: passed on to ->readpage() and ->readpages()
> + * @offset: start offset into @mapping, in PAGE_CACHE_SIZE units
> + * @req_size: hint: total size of the read which the caller is performing in
> + *            PAGE_CACHE_SIZE units
> + *
> + * page_cache_readahead() is the main function.  If performs the adaptive
>   * readahead window size management and submits the readahead I/O.
> + *
> + * Note that @filp is purely used for passing on to the ->readpage[s]()
> + * handler: it may refer to a different file from @mapping (so we may not use
> + * @filp->f_mapping or @filp->f_dentry->d_inode here).
> + * Also, @ra may not be equal to &@filp->f_ra.
> + *
>   */
>  unsigned long
>  page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
> -                    struct file *filp, unsigned long offset,
> -                    unsigned long req_size)
> +                    struct file *filp, pgoff_t offset, unsigned long req_size)
>  {
>         unsigned long max, newsize;
>         int sequential;

--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/

       reply	other threads:[~2005-11-03  1:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200511030145.jA31j8eB021068@shell0.pdx.osdl.net>
2005-11-03  1:58 ` Coywolf Qi Hunt [this message]
2005-11-07  5:20 ` + readahead-commentary.patch added to -mm tree Coywolf Qi Hunt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd57c900511021758j29ffb5f4l@mail.gmail.com \
    --to=coywolf@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.