Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[apparmor] constify struct path * in a bunch of helpers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 2c7661ff f55532a0

+8 -8
+1 -1
security/apparmor/file.c
··· 275 275 * 276 276 * Returns: %0 else error if access denied or other error 277 277 */ 278 - int aa_path_perm(int op, struct aa_profile *profile, struct path *path, 278 + int aa_path_perm(int op, struct aa_profile *profile, const struct path *path, 279 279 int flags, u32 request, struct path_cond *cond) 280 280 { 281 281 char *buffer = NULL;
+1 -1
security/apparmor/include/file.h
··· 171 171 const char *name, struct path_cond *cond, 172 172 struct file_perms *perms); 173 173 174 - int aa_path_perm(int op, struct aa_profile *profile, struct path *path, 174 + int aa_path_perm(int op, struct aa_profile *profile, const struct path *path, 175 175 int flags, u32 request, struct path_cond *cond); 176 176 177 177 int aa_path_link(struct aa_profile *profile, struct dentry *old_dentry,
+1 -1
security/apparmor/include/path.h
··· 26 26 PATH_MEDIATE_DELETED = 0x10000, /* mediate deleted paths */ 27 27 }; 28 28 29 - int aa_path_name(struct path *path, int flags, char **buffer, 29 + int aa_path_name(const struct path *path, int flags, char **buffer, 30 30 const char **name, const char **info); 31 31 32 32 #endif /* __AA_PATH_H */
+1 -1
security/apparmor/lsm.c
··· 149 149 * 150 150 * Returns: %0 else error code if error or permission denied 151 151 */ 152 - static int common_perm(int op, struct path *path, u32 mask, 152 + static int common_perm(int op, const struct path *path, u32 mask, 153 153 struct path_cond *cond) 154 154 { 155 155 struct aa_profile *profile;
+4 -4
security/apparmor/path.c
··· 53 53 * When no error the path name is returned in @name which points to 54 54 * to a position in @buf 55 55 */ 56 - static int d_namespace_path(struct path *path, char *buf, int buflen, 56 + static int d_namespace_path(const struct path *path, char *buf, int buflen, 57 57 char **name, int flags) 58 58 { 59 59 char *res; ··· 158 158 * 159 159 * Returns: %0 else error on failure 160 160 */ 161 - static int get_name_to_buffer(struct path *path, int flags, char *buffer, 161 + static int get_name_to_buffer(const struct path *path, int flags, char *buffer, 162 162 int size, char **name, const char **info) 163 163 { 164 164 int adjust = (flags & PATH_IS_DIR) ? 1 : 0; ··· 204 204 * 205 205 * Returns: %0 else error code if could retrieve name 206 206 */ 207 - int aa_path_name(struct path *path, int flags, char **buffer, const char **name, 208 - const char **info) 207 + int aa_path_name(const struct path *path, int flags, char **buffer, 208 + const char **name, const char **info) 209 209 { 210 210 char *buf, *str = NULL; 211 211 int size = 256;