kernel locking for releasing incore security

From: Hawk Xu (h.xu@private)
Date: Tue Dec 06 2005 - 01:04:46 PST


Hi!

What kind of kernel locking should I use when releasing the incore 
security information of inodes and tasks in the inode_free_security and 
task_free_security hook call?

For inodes:
spin_lock(&inode->i_lock);
...;
spin_unlock(&inode->i_lock);

For tasks:
spin_lock(&task->alloc_lock);
...;
spin_unlock(&task->alloc_lock);

Is the above code OK?  Or the above code may be called in 
non-user-context so we have to use spin_lock_irqsave() and 
spin_lock_irqrestore()?

Thanks!

-- 
Best regards,

Hawk Xu, M.S.C.S.
h.xu `echo "ta"|rev` 163 `echo "tod"|rev` com



This archive was generated by hypermail 2.1.3 : Tue Dec 06 2005 - 01:06:35 PST