Commit bc7e982b authored by Eric Paris's avatar Eric Paris Committed by Linus Torvalds

[PATCH] SELinux: convert sbsec semaphore to a mutex

This patch converts the semaphore in the superblock security struct to a
mutex.  No locking changes or other code changes are done.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Acked-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Acked-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 23970741
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include <net/ip.h> /* for sysctl_local_port_range[] */ #include <net/ip.h> /* for sysctl_local_port_range[] */
#include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/semaphore.h>
#include <asm/ioctls.h> #include <asm/ioctls.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -243,7 +242,7 @@ static int superblock_alloc_security(struct super_block *sb) ...@@ -243,7 +242,7 @@ static int superblock_alloc_security(struct super_block *sb)
if (!sbsec) if (!sbsec)
return -ENOMEM; return -ENOMEM;
init_MUTEX(&sbsec->sem); mutex_init(&sbsec->lock);
INIT_LIST_HEAD(&sbsec->list); INIT_LIST_HEAD(&sbsec->list);
INIT_LIST_HEAD(&sbsec->isec_head); INIT_LIST_HEAD(&sbsec->isec_head);
spin_lock_init(&sbsec->isec_lock); spin_lock_init(&sbsec->isec_lock);
...@@ -595,7 +594,7 @@ static int superblock_doinit(struct super_block *sb, void *data) ...@@ -595,7 +594,7 @@ static int superblock_doinit(struct super_block *sb, void *data)
struct inode *inode = root->d_inode; struct inode *inode = root->d_inode;
int rc = 0; int rc = 0;
down(&sbsec->sem); mutex_lock(&sbsec->lock);
if (sbsec->initialized) if (sbsec->initialized)
goto out; goto out;
...@@ -690,7 +689,7 @@ next_inode: ...@@ -690,7 +689,7 @@ next_inode:
} }
spin_unlock(&sbsec->isec_lock); spin_unlock(&sbsec->isec_lock);
out: out:
up(&sbsec->sem); mutex_unlock(&sbsec->lock);
return rc; return rc;
} }
......
...@@ -63,7 +63,7 @@ struct superblock_security_struct { ...@@ -63,7 +63,7 @@ struct superblock_security_struct {
unsigned int behavior; /* labeling behavior */ unsigned int behavior; /* labeling behavior */
unsigned char initialized; /* initialization flag */ unsigned char initialized; /* initialization flag */
unsigned char proc; /* proc fs */ unsigned char proc; /* proc fs */
struct semaphore sem; struct mutex lock;
struct list_head isec_head; struct list_head isec_head;
spinlock_t isec_lock; spinlock_t isec_lock;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment