LKML Archive on
help / color / mirror / Atom feed
From: "Ken Chen" <>
To: "Dave McCracken" <>
	"Andrew Morton" <>,
	"Adam Litke" <>
Subject: Re: [PATCH 1/1] Enable fully functional truncate for hugetlbfs
Date: Mon, 12 Feb 2007 14:14:43 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 2/12/07, Dave McCracken <> wrote:
> This patch enables the full functionality of truncate for hugetlbfs
> files.  Truncate was originally limited to reducing the file size
> because page faults were not supported for hugetlbfs.  Now that page
> faults have been implemented it is now possible to fully support
> truncate.


> --- 2.6.20/./fs/hugetlbfs/inode.c       2007-02-04 12:44:54.000000000 -0600
> +++ 2.6.20-htrunc/./fs/hugetlbfs/inode.c        2007-02-05 13:02:00.000000000 -0600
> +       if (hugetlb_reserve_pages(inode, inode->i_size >> HPAGE_SHIFT,
> +                                 offset >> HPAGE_SHIFT))
> +               goto out_mem;
> +       i_size_write(inode, offset);

hugetlb_reserve_pages() is used to reserve pages for shared mapping
and is used only for the size of mapping at the time of mmap().  We
shouldn't call this function when expanding hugetlb file.

- Ken

      reply	other threads:[~2007-02-12 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 14:28 [PATCH 1/1] Enable fully functional truncate for hugetlbfs Dave McCracken
2007-02-12 22:14 ` Ken Chen [this message]

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:

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

  git send-email \ \ \ \ \ \ \ \

* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).