From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: [4/11] hugetlb: wrap hugetlb_prefault with prefault_key()
Date: Tue, 12 Nov 2002 00:28:53 -0800 [thread overview]
Message-ID: <E18BWPl-0005KC-00@holomorphy> (raw)
This wraps hugetlb_prefault() with prefault_key() in order to isolate the
dependency on inodes for prefaulting the hugetlb vma.
hugetlbpage.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff -urpN htlb-2.5.47-3/arch/i386/mm/hugetlbpage.c htlb-2.5.47-4/arch/i386/mm/hugetlbpage.c
--- htlb-2.5.47-3/arch/i386/mm/hugetlbpage.c 2002-11-11 21:23:55.000000000 -0800
+++ htlb-2.5.47-4/arch/i386/mm/hugetlbpage.c 2002-11-11 21:30:36.000000000 -0800
@@ -350,12 +350,18 @@ static int check_size_prot(struct inode
return 0;
}
+static int prefault_key(struct hugetlb_key *key, struct vm_area_struct *vma)
+{
+ struct inode *inode = (struct inode *)key;
+
+ return hugetlb_prefault(inode->i_mapping, vma);
+}
+
static int alloc_shared_hugetlb_pages(int key, unsigned long addr, unsigned long len, int prot, int flag)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct inode *inode;
- struct address_space *mapping;
int retval = -ENOMEM;
int newalloc = 0;
@@ -367,8 +373,6 @@ static int alloc_shared_hugetlb_pages(in
} else
spin_unlock(&htlbpage_lock);
- mapping = inode->i_mapping;
-
addr = do_mmap_pgoff(NULL, addr, len, (unsigned long) prot,
MAP_NORESERVE|MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, 0);
if (IS_ERR((void *) addr))
@@ -380,7 +384,7 @@ static int alloc_shared_hugetlb_pages(in
goto freeinode;
}
- retval = hugetlb_prefault(mapping, vma);
+ retval = prefault_key((struct hugetlb_key *)inode, vma);
if (retval)
goto out;
reply other threads:[~2002-11-12 8:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E18BWPl-0005KC-00@holomorphy \
--to=wli@holomorphy.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox