diff options
author | Phillip Lougher <phillip@lougher.demon.co.uk> | 2010-05-22 22:29:26 -0400 |
---|---|---|
committer | Phillip Lougher <phillip@lougher.demon.co.uk> | 2010-05-22 22:35:05 -0400 |
commit | f6db25a87643fa6108e211da0397423593ca36fe (patch) | |
tree | 5bf431bf1efea38a57186f4dc595966d4187e324 | |
parent | 0f87ee08564b95389e609699990725efd282021c (diff) |
squashfs: constify xattr handlers
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
-rw-r--r-- | fs/squashfs/squashfs.h | 2 | ||||
-rw-r--r-- | fs/squashfs/xattr.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h index 305ce15d2d2d..733a17c42945 100644 --- a/fs/squashfs/squashfs.h +++ b/fs/squashfs/squashfs.h | |||
@@ -100,7 +100,7 @@ extern const struct address_space_operations squashfs_symlink_aops; | |||
100 | extern const struct inode_operations squashfs_symlink_inode_ops; | 100 | extern const struct inode_operations squashfs_symlink_inode_ops; |
101 | 101 | ||
102 | /* xattr.c */ | 102 | /* xattr.c */ |
103 | extern struct xattr_handler *squashfs_xattr_handlers[]; | 103 | extern const struct xattr_handler *squashfs_xattr_handlers[]; |
104 | 104 | ||
105 | /* zlib_wrapper.c */ | 105 | /* zlib_wrapper.c */ |
106 | extern const struct squashfs_decompressor squashfs_zlib_comp_ops; | 106 | extern const struct squashfs_decompressor squashfs_zlib_comp_ops; |
diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c index de03889050b1..14a2feef09b9 100644 --- a/fs/squashfs/xattr.c +++ b/fs/squashfs/xattr.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "squashfs_fs_i.h" | 34 | #include "squashfs_fs_i.h" |
35 | #include "squashfs.h" | 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 | ssize_t squashfs_listxattr(struct dentry *d, char *buffer, | 39 | ssize_t squashfs_listxattr(struct dentry *d, char *buffer, |
40 | size_t buffer_size) | 40 | size_t buffer_size) |
@@ -57,7 +57,7 @@ ssize_t squashfs_listxattr(struct dentry *d, char *buffer, | |||
57 | while (count--) { | 57 | while (count--) { |
58 | struct squashfs_xattr_entry entry; | 58 | struct squashfs_xattr_entry entry; |
59 | struct squashfs_xattr_val val; | 59 | struct squashfs_xattr_val val; |
60 | struct xattr_handler *handler; | 60 | const struct xattr_handler *handler; |
61 | int name_size, prefix_size = 0; | 61 | int name_size, prefix_size = 0; |
62 | 62 | ||
63 | err = squashfs_read_metadata(sb, &entry, &start, &offset, | 63 | err = squashfs_read_metadata(sb, &entry, &start, &offset, |
@@ -228,7 +228,7 @@ static int squashfs_user_get(struct dentry *d, const char *name, void *buffer, | |||
228 | buffer, size); | 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 | .prefix = XATTR_USER_PREFIX, | 232 | .prefix = XATTR_USER_PREFIX, |
233 | .list = squashfs_user_list, | 233 | .list = squashfs_user_list, |
234 | .get = squashfs_user_get | 234 | .get = squashfs_user_get |
@@ -258,7 +258,7 @@ static int squashfs_trusted_get(struct dentry *d, const char *name, | |||
258 | buffer, size); | 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 | .prefix = XATTR_TRUSTED_PREFIX, | 262 | .prefix = XATTR_TRUSTED_PREFIX, |
263 | .list = squashfs_trusted_list, | 263 | .list = squashfs_trusted_list, |
264 | .get = squashfs_trusted_get | 264 | .get = squashfs_trusted_get |
@@ -285,13 +285,13 @@ static int squashfs_security_get(struct dentry *d, const char *name, | |||
285 | buffer, size); | 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 | .prefix = XATTR_SECURITY_PREFIX, | 289 | .prefix = XATTR_SECURITY_PREFIX, |
290 | .list = squashfs_security_list, | 290 | .list = squashfs_security_list, |
291 | .get = squashfs_security_get | 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 | if (type & ~(SQUASHFS_XATTR_PREFIX_MASK | SQUASHFS_XATTR_VALUE_OOL)) | 296 | if (type & ~(SQUASHFS_XATTR_PREFIX_MASK | SQUASHFS_XATTR_VALUE_OOL)) |
297 | /* ignore unrecognised type */ | 297 | /* ignore unrecognised type */ |
@@ -310,7 +310,7 @@ static inline struct xattr_handler *squashfs_xattr_handler(int type) | |||
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | struct xattr_handler *squashfs_xattr_handlers[] = { | 313 | const struct xattr_handler *squashfs_xattr_handlers[] = { |
314 | &squashfs_xattr_user_handler, | 314 | &squashfs_xattr_user_handler, |
315 | &squashfs_xattr_trusted_handler, | 315 | &squashfs_xattr_trusted_handler, |
316 | &squashfs_xattr_security_handler, | 316 | &squashfs_xattr_security_handler, |