Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165643
b: refs/heads/master
c: ef1ff6b
h: refs/heads/master
i:
  165641: 283c049
  165639: 856accc
v: v3
  • Loading branch information
From: Mel Gorman authored and Linus Torvalds committed Sep 24, 2009
1 parent e50c7ee commit 54ea090
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c6854fdadf940678fd54779b778f6faafb870bb
refs/heads/master: ef1ff6b8c08954bc203b59e887d1e580dd91755a
12 changes: 3 additions & 9 deletions trunk/fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,15 +936,9 @@ static struct file_system_type hugetlbfs_fs_type = {

static struct vfsmount *hugetlbfs_vfsmount;

static int can_do_hugetlb_shm(int creat_flags)
static int can_do_hugetlb_shm(void)
{
if (creat_flags != HUGETLB_SHMFS_INODE)
return 0;
if (capable(CAP_IPC_LOCK))
return 1;
if (in_group_p(sysctl_hugetlb_shm_group))
return 1;
return 0;
return capable(CAP_IPC_LOCK) || in_group_p(sysctl_hugetlb_shm_group);
}

struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag,
Expand All @@ -960,7 +954,7 @@ struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag,
if (!hugetlbfs_vfsmount)
return ERR_PTR(-ENOENT);

if (!can_do_hugetlb_shm(creat_flags)) {
if (creat_flags == HUGETLB_SHMFS_INODE && !can_do_hugetlb_shm()) {
*user = current_user();
if (user_shm_lock(size, *user)) {
WARN_ONCE(1,
Expand Down

0 comments on commit 54ea090

Please sign in to comment.