aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/util.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
committerJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
commitec98ce480ada787f2cfbd696980ff3564415505b (patch)
tree1a4d644b38f9f1e4b4e086fde0b195df4a92cf84 /ipc/util.c
parent3496f92beb9aa99ef21fccc154a36c7698e9c538 (diff)
parentfeaf3848a813a106f163013af6fcf6c4bfec92d9 (diff)
Merge branch 'master' into next
Conflicts: fs/nfsd/nfs4recover.c Manually fixed above to use new creds API functions, e.g. nfs4_save_creds(). Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ipc/util.c b/ipc/util.c
index c8a76701b6c9..5a1808c774a2 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -268,9 +268,17 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
268 if (ids->in_use >= size) 268 if (ids->in_use >= size)
269 return -ENOSPC; 269 return -ENOSPC;
270 270
271 spin_lock_init(&new->lock);
272 new->deleted = 0;
273 rcu_read_lock();
274 spin_lock(&new->lock);
275
271 err = idr_get_new(&ids->ipcs_idr, new, &id); 276 err = idr_get_new(&ids->ipcs_idr, new, &id);
272 if (err) 277 if (err) {
278 spin_unlock(&new->lock);
279 rcu_read_unlock();
273 return err; 280 return err;
281 }
274 282
275 ids->in_use++; 283 ids->in_use++;
276 284
@@ -283,10 +291,6 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
283 ids->seq = 0; 291 ids->seq = 0;
284 292
285 new->id = ipc_buildid(id, new->seq); 293 new->id = ipc_buildid(id, new->seq);
286 spin_lock_init(&new->lock);
287 new->deleted = 0;
288 rcu_read_lock();
289 spin_lock(&new->lock);
290 return id; 294 return id;
291} 295}
292 296