~apparmor-dev/apparmor/master

« back to all changes in this revision

Viewing changes to kernel-patches/4.5/0016-apparmor-use-list_next_entry-instead-of-list_entry_n.patch

  • Committer: Steve Beattie
  • Date: 2019-02-19 09:38:13 UTC
  • Revision ID: sbeattie@ubuntu.com-20190219093813-ud526ee6hwn8nljz
The AppArmor project has been converted to git and is now hosted on
gitlab.

To get the converted repository, please do
  git clone https://gitlab.com/apparmor/apparmor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 84acc6aa6976e62756e14d3a00c5634724cbaa59 Mon Sep 17 00:00:00 2001
2
 
From: Geliang Tang <geliangtang@163.com>
3
 
Date: Mon, 16 Nov 2015 21:46:33 +0800
4
 
Subject: [PATCH 16/27] apparmor: use list_next_entry instead of
5
 
 list_entry_next
6
 
 
7
 
list_next_entry has been defined in list.h, so I replace list_entry_next
8
 
with it.
9
 
 
10
 
Signed-off-by: Geliang Tang <geliangtang@163.com>
11
 
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
12
 
Signed-off-by: John Johansen <john.johansen@canonical.com>
13
 
---
14
 
 security/apparmor/apparmorfs.c | 8 +++-----
15
 
 1 file changed, 3 insertions(+), 5 deletions(-)
16
 
 
17
 
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
18
 
index 0d8dd71..729e595 100644
19
 
--- a/security/apparmor/apparmorfs.c
20
 
+++ b/security/apparmor/apparmorfs.c
21
 
@@ -553,8 +553,6 @@ fail2:
22
 
 }
23
 
 
24
 
 
25
 
-#define list_entry_next(pos, member) \
26
 
-       list_entry(pos->member.next, typeof(*pos), member)
27
 
 #define list_entry_is_head(pos, head, member) (&pos->member == (head))
28
 
 
29
 
 /**
30
 
@@ -585,7 +583,7 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root,
31
 
        parent = ns->parent;
32
 
        while (ns != root) {
33
 
                mutex_unlock(&ns->lock);
34
 
-               next = list_entry_next(ns, base.list);
35
 
+               next = list_next_entry(ns, base.list);
36
 
                if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
37
 
                        mutex_lock(&next->lock);
38
 
                        return next;
39
 
@@ -639,7 +637,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
40
 
        parent = rcu_dereference_protected(p->parent,
41
 
                                           mutex_is_locked(&p->ns->lock));
42
 
        while (parent) {
43
 
-               p = list_entry_next(p, base.list);
44
 
+               p = list_next_entry(p, base.list);
45
 
                if (!list_entry_is_head(p, &parent->base.profiles, base.list))
46
 
                        return p;
47
 
                p = parent;
48
 
@@ -648,7 +646,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
49
 
        }
50
 
 
51
 
        /* is next another profile in the namespace */
52
 
-       p = list_entry_next(p, base.list);
53
 
+       p = list_next_entry(p, base.list);
54
 
        if (!list_entry_is_head(p, &ns->base.profiles, base.list))
55
 
                return p;
56
 
 
57
 
2.7.4
58