Commit f6db25a87643fa6108e211da0397423593ca36fe
1 parent
0f87ee0856
Exists in
master
and in
4 other branches
squashfs: constify xattr handlers
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Showing 2 changed files with 8 additions and 8 deletions Side-by-side Diff
fs/squashfs/squashfs.h
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | extern const struct inode_operations squashfs_symlink_inode_ops; |
101 | 101 | |
102 | 102 | /* xattr.c */ |
103 | -extern struct xattr_handler *squashfs_xattr_handlers[]; | |
103 | +extern const struct xattr_handler *squashfs_xattr_handlers[]; | |
104 | 104 | |
105 | 105 | /* zlib_wrapper.c */ |
106 | 106 | extern const struct squashfs_decompressor squashfs_zlib_comp_ops; |
fs/squashfs/xattr.c
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | #include "squashfs_fs_i.h" |
35 | 35 | #include "squashfs.h" |
36 | 36 | |
37 | -static struct xattr_handler *squashfs_xattr_handler(int); | |
37 | +static const struct xattr_handler *squashfs_xattr_handler(int); | |
38 | 38 | |
39 | 39 | ssize_t squashfs_listxattr(struct dentry *d, char *buffer, |
40 | 40 | size_t buffer_size) |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | while (count--) { |
58 | 58 | struct squashfs_xattr_entry entry; |
59 | 59 | struct squashfs_xattr_val val; |
60 | - struct xattr_handler *handler; | |
60 | + const struct xattr_handler *handler; | |
61 | 61 | int name_size, prefix_size = 0; |
62 | 62 | |
63 | 63 | err = squashfs_read_metadata(sb, &entry, &start, &offset, |
... | ... | @@ -228,7 +228,7 @@ |
228 | 228 | buffer, size); |
229 | 229 | } |
230 | 230 | |
231 | -static struct xattr_handler squashfs_xattr_user_handler = { | |
231 | +static const struct xattr_handler squashfs_xattr_user_handler = { | |
232 | 232 | .prefix = XATTR_USER_PREFIX, |
233 | 233 | .list = squashfs_user_list, |
234 | 234 | .get = squashfs_user_get |
... | ... | @@ -258,7 +258,7 @@ |
258 | 258 | buffer, size); |
259 | 259 | } |
260 | 260 | |
261 | -static struct xattr_handler squashfs_xattr_trusted_handler = { | |
261 | +static const struct xattr_handler squashfs_xattr_trusted_handler = { | |
262 | 262 | .prefix = XATTR_TRUSTED_PREFIX, |
263 | 263 | .list = squashfs_trusted_list, |
264 | 264 | .get = squashfs_trusted_get |
265 | 265 | |
... | ... | @@ -285,13 +285,13 @@ |
285 | 285 | buffer, size); |
286 | 286 | } |
287 | 287 | |
288 | -static struct xattr_handler squashfs_xattr_security_handler = { | |
288 | +static const struct xattr_handler squashfs_xattr_security_handler = { | |
289 | 289 | .prefix = XATTR_SECURITY_PREFIX, |
290 | 290 | .list = squashfs_security_list, |
291 | 291 | .get = squashfs_security_get |
292 | 292 | }; |
293 | 293 | |
294 | -static inline struct xattr_handler *squashfs_xattr_handler(int type) | |
294 | +static inline const struct xattr_handler *squashfs_xattr_handler(int type) | |
295 | 295 | { |
296 | 296 | if (type & ~(SQUASHFS_XATTR_PREFIX_MASK | SQUASHFS_XATTR_VALUE_OOL)) |
297 | 297 | /* ignore unrecognised type */ |
... | ... | @@ -310,7 +310,7 @@ |
310 | 310 | } |
311 | 311 | } |
312 | 312 | |
313 | -struct xattr_handler *squashfs_xattr_handlers[] = { | |
313 | +const struct xattr_handler *squashfs_xattr_handlers[] = { | |
314 | 314 | &squashfs_xattr_user_handler, |
315 | 315 | &squashfs_xattr_trusted_handler, |
316 | 316 | &squashfs_xattr_security_handler, |