apparmor/kernel-patches/for-mainline/rename-profile-lock.diff
2007-02-15 03:46:53 +00:00

112 lines
2.9 KiB
Diff

Index: b/security/apparmor/list.c
===================================================================
--- a/security/apparmor/list.c
+++ b/security/apparmor/list.c
@@ -15,7 +15,7 @@
/* list of all profiles and lock */
static LIST_HEAD(profile_list);
-static rwlock_t profile_lock = RW_LOCK_UNLOCKED;
+static rwlock_t profile_list_lock = RW_LOCK_UNLOCKED;
/* list of all task_contexts and lock */
static LIST_HEAD(task_context_list);
@@ -32,9 +32,9 @@ struct aa_profile *aa_profilelist_find(c
{
struct aa_profile *p = NULL;
if (name) {
- read_lock(&profile_lock);
+ read_lock(&profile_list_lock);
p = __aa_find_profile(name, &profile_list);
- read_unlock(&profile_lock);
+ read_unlock(&profile_list_lock);
}
return p;
}
@@ -57,7 +57,7 @@ int aa_profilelist_add(struct aa_profile
if (!profile)
goto out;
- write_lock(&profile_lock);
+ write_lock(&profile_list_lock);
old_profile = __aa_find_profile(profile->name, &profile_list);
if (old_profile) {
aa_put_profile(old_profile);
@@ -67,7 +67,7 @@ int aa_profilelist_add(struct aa_profile
list_add(&profile->list, &profile_list);
ret = 1;
out:
- write_unlock(&profile_lock);
+ write_unlock(&profile_list_lock);
return ret;
}
@@ -87,7 +87,7 @@ struct aa_profile *aa_profilelist_remove
if (!name)
goto out;
- write_lock(&profile_lock);
+ write_lock(&profile_list_lock);
list_for_each_entry_safe(p, tmp, &profile_list, list) {
if (!strcmp(p->name, name)) {
list_del_init(&p->list);
@@ -97,7 +97,7 @@ struct aa_profile *aa_profilelist_remove
break;
}
}
- write_unlock(&profile_lock);
+ write_unlock(&profile_list_lock);
out:
return profile;
@@ -118,7 +118,7 @@ struct aa_profile *aa_profilelist_replac
{
struct aa_profile *oldprofile;
- write_lock(&profile_lock);
+ write_lock(&profile_list_lock);
oldprofile = __aa_find_profile(profile->name, &profile_list);
if (oldprofile) {
list_del_init(&oldprofile->list);
@@ -130,7 +130,7 @@ struct aa_profile *aa_profilelist_replac
}
list_add(&profile->list, &profile_list);
- write_unlock(&profile_lock);
+ write_unlock(&profile_list_lock);
return oldprofile;
}
@@ -142,12 +142,12 @@ void aa_profilelist_release(void)
{
struct aa_profile *p, *tmp;
- write_lock(&profile_lock);
+ write_lock(&profile_list_lock);
list_for_each_entry_safe(p, tmp, &profile_list, list) {
list_del_init(&p->list);
aa_put_profile(p);
}
- write_unlock(&profile_lock);
+ write_unlock(&profile_list_lock);
}
/**
@@ -233,7 +233,7 @@ static void *p_start(struct seq_file *f,
struct aa_profile *node;
loff_t l = *pos;
- read_lock(&profile_lock);
+ read_lock(&profile_list_lock);
list_for_each_entry(node, &profile_list, list)
if (!l--)
return node;
@@ -250,7 +250,7 @@ static void *p_next(struct seq_file *f,
static void p_stop(struct seq_file *f, void *v)
{
- read_unlock(&profile_lock);
+ read_unlock(&profile_list_lock);
}
static int seq_show_profile(struct seq_file *f, void *v)