diff options
author | Len Brown <len.brown@intel.com> | 2005-12-06 17:31:30 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-12-06 17:31:30 -0500 |
commit | 3d5271f9883cba7b54762bc4fe027d4172f06db7 (patch) | |
tree | ab8a881a14478598a0c8bda0d26c62cdccfffd6d /ipc | |
parent | 378b2556f4e09fa6f87ff0cb5c4395ff28257d02 (diff) | |
parent | 9115a6c787596e687df03010d97fccc5e0762506 (diff) |
Pull release into acpica branch
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 3 | ||||
-rw-r--r-- | ipc/shm.c | 17 | ||||
-rw-r--r-- | ipc/util.c | 9 |
3 files changed, 20 insertions, 9 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 3a926011507b..c8943b53d8e6 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * POSIX message queues filesystem for Linux. | 2 | * POSIX message queues filesystem for Linux. |
3 | * | 3 | * |
4 | * Copyright (C) 2003,2004 Krzysztof Benedyczak (golbi@mat.uni.torun.pl) | 4 | * Copyright (C) 2003,2004 Krzysztof Benedyczak (golbi@mat.uni.torun.pl) |
5 | * Michal Wronski (wrona@mat.uni.torun.pl) | 5 | * Michal Wronski (Michal.Wronski@motorola.com) |
6 | * | 6 | * |
7 | * Spinlocks: Mohamed Abbas (abbas.mohamed@intel.com) | 7 | * Spinlocks: Mohamed Abbas (abbas.mohamed@intel.com) |
8 | * Lockless receive & send, fd based notify: | 8 | * Lockless receive & send, fd based notify: |
@@ -611,6 +611,7 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry, | |||
611 | dentry->d_fsdata = &attr; | 611 | dentry->d_fsdata = &attr; |
612 | } | 612 | } |
613 | 613 | ||
614 | mode &= ~current->fs->umask; | ||
614 | ret = vfs_create(dir->d_inode, dentry, mode, NULL); | 615 | ret = vfs_create(dir->d_inode, dentry, mode, NULL); |
615 | dentry->d_fsdata = NULL; | 616 | dentry->d_fsdata = NULL; |
616 | if (ret) | 617 | if (ret) |
@@ -212,8 +212,16 @@ static int newseg (key_t key, int shmflg, size_t size) | |||
212 | file = hugetlb_zero_setup(size); | 212 | file = hugetlb_zero_setup(size); |
213 | shp->mlock_user = current->user; | 213 | shp->mlock_user = current->user; |
214 | } else { | 214 | } else { |
215 | int acctflag = VM_ACCOUNT; | ||
216 | /* | ||
217 | * Do not allow no accounting for OVERCOMMIT_NEVER, even | ||
218 | * if it's asked for. | ||
219 | */ | ||
220 | if ((shmflg & SHM_NORESERVE) && | ||
221 | sysctl_overcommit_memory != OVERCOMMIT_NEVER) | ||
222 | acctflag = 0; | ||
215 | sprintf (name, "SYSV%08x", key); | 223 | sprintf (name, "SYSV%08x", key); |
216 | file = shmem_file_setup(name, size, VM_ACCOUNT); | 224 | file = shmem_file_setup(name, size, acctflag); |
217 | } | 225 | } |
218 | error = PTR_ERR(file); | 226 | error = PTR_ERR(file); |
219 | if (IS_ERR(file)) | 227 | if (IS_ERR(file)) |
@@ -233,10 +241,11 @@ static int newseg (key_t key, int shmflg, size_t size) | |||
233 | shp->id = shm_buildid(id,shp->shm_perm.seq); | 241 | shp->id = shm_buildid(id,shp->shm_perm.seq); |
234 | shp->shm_file = file; | 242 | shp->shm_file = file; |
235 | file->f_dentry->d_inode->i_ino = shp->id; | 243 | file->f_dentry->d_inode->i_ino = shp->id; |
236 | if (shmflg & SHM_HUGETLB) | 244 | |
237 | set_file_hugepages(file); | 245 | /* Hugetlb ops would have already been assigned. */ |
238 | else | 246 | if (!(shmflg & SHM_HUGETLB)) |
239 | file->f_op = &shm_file_operations; | 247 | file->f_op = &shm_file_operations; |
248 | |||
240 | shm_tot += numpages; | 249 | shm_tot += numpages; |
241 | shm_unlock(shp); | 250 | shm_unlock(shp); |
242 | return shp->id; | 251 | return shp->id; |
diff --git a/ipc/util.c b/ipc/util.c index 10e836d0d89e..23f1cec150c1 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -410,7 +410,8 @@ void ipc_rcu_getref(void *ptr) | |||
410 | } | 410 | } |
411 | 411 | ||
412 | /** | 412 | /** |
413 | * ipc_schedule_free - free ipc + rcu space | 413 | * ipc_schedule_free - free ipc + rcu space |
414 | * @head: RCU callback structure for queued work | ||
414 | * | 415 | * |
415 | * Since RCU callback function is called in bh, | 416 | * Since RCU callback function is called in bh, |
416 | * we need to defer the vfree to schedule_work | 417 | * we need to defer the vfree to schedule_work |
@@ -427,10 +428,10 @@ static void ipc_schedule_free(struct rcu_head *head) | |||
427 | } | 428 | } |
428 | 429 | ||
429 | /** | 430 | /** |
430 | * ipc_immediate_free - free ipc + rcu space | 431 | * ipc_immediate_free - free ipc + rcu space |
431 | * | 432 | * @head: RCU callback structure that contains pointer to be freed |
432 | * Free from the RCU callback context | ||
433 | * | 433 | * |
434 | * Free from the RCU callback context | ||
434 | */ | 435 | */ |
435 | static void ipc_immediate_free(struct rcu_head *head) | 436 | static void ipc_immediate_free(struct rcu_head *head) |
436 | { | 437 | { |