Re: [PATCH 1/1] Enable fully functional truncate for hugetlbfs

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

 



On 2/12/07, Dave McCracken <[email protected]> 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.

ye!

--- 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
-
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