Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105963
b: refs/heads/master
c: 983bfb7
h: refs/heads/master
i:
  105961: 6f75e16
  105959: bde4956
v: v3
  • Loading branch information
Nadia Derbey authored and Linus Torvalds committed Jul 25, 2008
1 parent 51f0c17 commit 8833434
Show file tree
Hide file tree
Showing 2 changed files with 1 addition 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: cf481c20c476ad2c0febdace9ce23f5a4db19582
refs/heads/master: 983bfb7db303cfde56ae5bbf4e0f2f46e38c9576
9 changes: 0 additions & 9 deletions trunk/ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,29 +688,20 @@ void ipc64_perm_to_ipc_perm (struct ipc64_perm *in, struct ipc_perm *out)
* Look for an id in the ipc ids idr and lock the associated ipc object.
*
* The ipc object is locked on exit.
*
* This is the routine that should be called when the rw_mutex is not already
* held, i.e. idr tree not protected: it protects the idr tree in read mode
* during the idr_find().
*/

struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
{
struct kern_ipc_perm *out;
int lid = ipcid_to_idx(id);

down_read(&ids->rw_mutex);

rcu_read_lock();
out = idr_find(&ids->ipcs_idr, lid);
if (out == NULL) {
rcu_read_unlock();
up_read(&ids->rw_mutex);
return ERR_PTR(-EINVAL);
}

up_read(&ids->rw_mutex);

spin_lock(&out->lock);

/* ipc_rmid() may have already freed the ID while ipc_lock
Expand Down

0 comments on commit 8833434

Please sign in to comment.