summaryrefslogtreecommitdiffstats
path: root/fs/pnode.h
diff options
context:
space:
mode:
authorAdam Litke <agl@us.ibm.com>2007-11-15 01:59:39 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-15 03:45:40 +0100
commit2fc39cec6a9b5b41727d3386b780b69422a15152 (patch)
tree4b01dcef394a109ae3ff83189f7386ff3cdb3f61 /fs/pnode.h
parenthugetlb: fix quota management for private mappings (diff)
downloadlinux-2fc39cec6a9b5b41727d3386b780b69422a15152.tar.xz
linux-2fc39cec6a9b5b41727d3386b780b69422a15152.zip
hugetlb: debit quota in alloc_huge_page
Now that quota is credited by free_huge_page(), calls to hugetlb_get_quota() seem out of place. The alloc/free API is unbalanced because we handle the hugetlb_put_quota() but expect the caller to open-code hugetlb_get_quota(). Move the get inside alloc_huge_page to clean up this disparity. This patch has been kept apart from the previous patch because of the somewhat dodgy ERR_PTR() use herein. Moving the quota logic means that alloc_huge_page() has two failure modes. Quota failure must result in a SIGBUS while a standard allocation failure is OOM. Unfortunately, ERR_PTR() doesn't like the small positive errnos we have in VM_FAULT_* so they must be negated before they are used. Does anyone take issue with the way I am using PTR_ERR. If so, what are your thoughts on how to clean this up (without needing an if,else if,else block at each alloc_huge_page() callsite)? Signed-off-by: Adam Litke <agl@us.ibm.com> Cc: Ken Chen <kenchen@google.com> Cc: Andy Whitcroft <apw@shadowen.org> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: David Gibson <hermes@gibson.dropbear.id.au> Cc: William Lee Irwin III <wli@holomorphy.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/pnode.h')
0 files changed, 0 insertions, 0 deletions