lkml.org 
[lkml]   [2008]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] cred: remove const qualifiers
Date
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


\
 
 \ /
  Last update: 2008-08-21 15:27    [W:0.034 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site