Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH] cred: remove const qualifiers | Date | Thu, 21 Aug 2008 14:24:12 +0100 |
| |
Andrew Morton <akpm@linux-foundation.org> wrote:
> That information should have been included in a code comment.
It was explained in the covering note:
Subject: [PATCH 00/24] Introduce credentials [ver #7] ... (c) task_struct::cred is a const struct cred *, as are all pointers that aren't used specifically for creating new credentials. This catches places that are changing creds when they shouldn't be at compile time.
To get a new ref on a const cred, use get_cred() which casts away the const and calls atomic_inc().
It should've gone in the log entry for the "CRED: Inaugurate COW credentials" patch and also into the documentation. I don't know whether I can amend the former, but I can amend the latter. I'll also amend the comment to make it crystal clear.
David
| |