Commit:     7aa91e104028b87ff13f5eeb7a0d7ffe7b5a2348
Parent:     54f9f80d6543fb7b157d3b11e2e7911dc1379790
Author:     Ken Chen <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:26:21 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:43:02 2007 -0700

    hugetlb: allow extending ftruncate on hugetlbfs
    For historical reason, expanding ftruncate that increases file size on
    hugetlbfs is not allowed due to pages were pre-faulted and lack of fault
    handler.  Now that we have demand faulting on hugetlb since 2.6.15, there
    is no reason to hold back that limitation.
    This will make hugetlbfs behave more like a normal fs.  I'm writing a user
    level code that uses hugetlbfs but will fall back to tmpfs if there are no
    hugetlb page available in the system.  Having hugetlbfs specific ftruncate
    behavior is a bit quirky and I would like to remove that artificial
    Signed-off-by: <[EMAIL PROTECTED]>
    Acked-by: Wiliam Irwin <[EMAIL PROTECTED]>
    Cc: Adam Litke <[EMAIL PROTECTED]>
    Cc: David Gibson <[EMAIL PROTECTED]>
    Cc: Nishanth Aravamudan <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/hugetlbfs/inode.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 70fbb29..8f8e133 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -322,21 +322,15 @@ hugetlb_vmtruncate_list(struct prio_tree_root *root, 
pgoff_t pgoff)
- * Expanding truncates are not allowed.
- */
 static int hugetlb_vmtruncate(struct inode *inode, loff_t offset)
        pgoff_t pgoff;
        struct address_space *mapping = inode->i_mapping;
-       if (offset > inode->i_size)
-               return -EINVAL;
        BUG_ON(offset & ~HPAGE_MASK);
        pgoff = offset >> PAGE_SHIFT;
-       inode->i_size = offset;
+       i_size_write(inode, offset);
        if (!prio_tree_empty(&mapping->i_mmap))
                hugetlb_vmtruncate_list(&mapping->i_mmap, pgoff);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to