~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/rename-profile-lock.diff

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: b/security/apparmor/list.c
2
 
===================================================================
3
 
--- a/security/apparmor/list.c
4
 
+++ b/security/apparmor/list.c
5
 
@@ -15,7 +15,7 @@
6
 
 
7
 
 /* list of all profiles and lock */
8
 
 static LIST_HEAD(profile_list);
9
 
-static rwlock_t profile_lock = RW_LOCK_UNLOCKED;
10
 
+static rwlock_t profile_list_lock = RW_LOCK_UNLOCKED;
11
 
 
12
 
 /* list of all task_contexts and lock */
13
 
 static LIST_HEAD(task_context_list);
14
 
@@ -32,9 +32,9 @@ struct aa_profile *aa_profilelist_find(c
15
 
 {
16
 
        struct aa_profile *p = NULL;
17
 
        if (name) {
18
 
-               read_lock(&profile_lock);
19
 
+               read_lock(&profile_list_lock);
20
 
                p = __aa_find_profile(name, &profile_list);
21
 
-               read_unlock(&profile_lock);
22
 
+               read_unlock(&profile_list_lock);
23
 
        }
24
 
        return p;
25
 
 }
26
 
@@ -57,7 +57,7 @@ int aa_profilelist_add(struct aa_profile
27
 
        if (!profile)
28
 
                goto out;
29
 
 
30
 
-       write_lock(&profile_lock);
31
 
+       write_lock(&profile_list_lock);
32
 
        old_profile = __aa_find_profile(profile->name, &profile_list);
33
 
        if (old_profile) {
34
 
                aa_put_profile(old_profile);
35
 
@@ -67,7 +67,7 @@ int aa_profilelist_add(struct aa_profile
36
 
        list_add(&profile->list, &profile_list);
37
 
        ret = 1;
38
 
  out:
39
 
-       write_unlock(&profile_lock);
40
 
+       write_unlock(&profile_list_lock);
41
 
        return ret;
42
 
 }
43
 
 
44
 
@@ -87,7 +87,7 @@ struct aa_profile *aa_profilelist_remove
45
 
        if (!name)
46
 
                goto out;
47
 
 
48
 
-       write_lock(&profile_lock);
49
 
+       write_lock(&profile_list_lock);
50
 
        list_for_each_entry_safe(p, tmp, &profile_list, list) {
51
 
                if (!strcmp(p->name, name)) {
52
 
                        list_del_init(&p->list);
53
 
@@ -97,7 +97,7 @@ struct aa_profile *aa_profilelist_remove
54
 
                        break;
55
 
                }
56
 
        }
57
 
-       write_unlock(&profile_lock);
58
 
+       write_unlock(&profile_list_lock);
59
 
 
60
 
 out:
61
 
        return profile;
62
 
@@ -118,7 +118,7 @@ struct aa_profile *aa_profilelist_replac
63
 
 {
64
 
        struct aa_profile *oldprofile;
65
 
 
66
 
-       write_lock(&profile_lock);
67
 
+       write_lock(&profile_list_lock);
68
 
        oldprofile = __aa_find_profile(profile->name, &profile_list);
69
 
        if (oldprofile) {
70
 
                list_del_init(&oldprofile->list);
71
 
@@ -130,7 +130,7 @@ struct aa_profile *aa_profilelist_replac
72
 
        }
73
 
 
74
 
        list_add(&profile->list, &profile_list);
75
 
-       write_unlock(&profile_lock);
76
 
+       write_unlock(&profile_list_lock);
77
 
 
78
 
        return oldprofile;
79
 
 }
80
 
@@ -142,12 +142,12 @@ void aa_profilelist_release(void)
81
 
 {
82
 
        struct aa_profile *p, *tmp;
83
 
 
84
 
-       write_lock(&profile_lock);
85
 
+       write_lock(&profile_list_lock);
86
 
        list_for_each_entry_safe(p, tmp, &profile_list, list) {
87
 
                list_del_init(&p->list);
88
 
                aa_put_profile(p);
89
 
        }
90
 
-       write_unlock(&profile_lock);
91
 
+       write_unlock(&profile_list_lock);
92
 
 }
93
 
 
94
 
 /**
95
 
@@ -233,7 +233,7 @@ static void *p_start(struct seq_file *f,
96
 
        struct aa_profile *node;
97
 
        loff_t l = *pos;
98
 
 
99
 
-       read_lock(&profile_lock);
100
 
+       read_lock(&profile_list_lock);
101
 
        list_for_each_entry(node, &profile_list, list)
102
 
                if (!l--)
103
 
                        return node;
104
 
@@ -250,7 +250,7 @@ static void *p_next(struct seq_file *f, 
105
 
 
106
 
 static void p_stop(struct seq_file *f, void *v)
107
 
 {
108
 
-       read_unlock(&profile_lock);
109
 
+       read_unlock(&profile_list_lock);
110
 
 }
111
 
 
112
 
 static int seq_show_profile(struct seq_file *f, void *v)