Commit d1f21049f9185e589849051d94c9a50151c6a7dc

Authored by Stephen Hemminger
Committed by Al Viro
1 parent 749c72efa4

ext3: constify xattr handlers

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 6 changed files with 16 additions and 16 deletions Side-by-side Diff

... ... @@ -456,7 +456,7 @@
456 456 return error;
457 457 }
458 458  
459   -struct xattr_handler ext3_xattr_acl_access_handler = {
  459 +const struct xattr_handler ext3_xattr_acl_access_handler = {
460 460 .prefix = POSIX_ACL_XATTR_ACCESS,
461 461 .flags = ACL_TYPE_ACCESS,
462 462 .list = ext3_xattr_list_acl_access,
... ... @@ -464,7 +464,7 @@
464 464 .set = ext3_xattr_set_acl,
465 465 };
466 466  
467   -struct xattr_handler ext3_xattr_acl_default_handler = {
  467 +const struct xattr_handler ext3_xattr_acl_default_handler = {
468 468 .prefix = POSIX_ACL_XATTR_DEFAULT,
469 469 .flags = ACL_TYPE_DEFAULT,
470 470 .list = ext3_xattr_list_acl_default,
... ... @@ -104,7 +104,7 @@
104 104  
105 105 static struct mb_cache *ext3_xattr_cache;
106 106  
107   -static struct xattr_handler *ext3_xattr_handler_map[] = {
  107 +static const struct xattr_handler *ext3_xattr_handler_map[] = {
108 108 [EXT3_XATTR_INDEX_USER] = &ext3_xattr_user_handler,
109 109 #ifdef CONFIG_EXT3_FS_POSIX_ACL
110 110 [EXT3_XATTR_INDEX_POSIX_ACL_ACCESS] = &ext3_xattr_acl_access_handler,
... ... @@ -116,7 +116,7 @@
116 116 #endif
117 117 };
118 118  
119   -struct xattr_handler *ext3_xattr_handlers[] = {
  119 +const struct xattr_handler *ext3_xattr_handlers[] = {
120 120 &ext3_xattr_user_handler,
121 121 &ext3_xattr_trusted_handler,
122 122 #ifdef CONFIG_EXT3_FS_POSIX_ACL
123 123  
... ... @@ -129,10 +129,10 @@
129 129 NULL
130 130 };
131 131  
132   -static inline struct xattr_handler *
  132 +static inline const struct xattr_handler *
133 133 ext3_xattr_handler(int name_index)
134 134 {
135   - struct xattr_handler *handler = NULL;
  135 + const struct xattr_handler *handler = NULL;
136 136  
137 137 if (name_index > 0 && name_index < ARRAY_SIZE(ext3_xattr_handler_map))
138 138 handler = ext3_xattr_handler_map[name_index];
... ... @@ -338,7 +338,7 @@
338 338 size_t rest = buffer_size;
339 339  
340 340 for (; !IS_LAST_ENTRY(entry); entry = EXT3_XATTR_NEXT(entry)) {
341   - struct xattr_handler *handler =
  341 + const struct xattr_handler *handler =
342 342 ext3_xattr_handler(entry->e_name_index);
343 343  
344 344 if (handler) {
... ... @@ -58,11 +58,11 @@
58 58  
59 59 # ifdef CONFIG_EXT3_FS_XATTR
60 60  
61   -extern struct xattr_handler ext3_xattr_user_handler;
62   -extern struct xattr_handler ext3_xattr_trusted_handler;
63   -extern struct xattr_handler ext3_xattr_acl_access_handler;
64   -extern struct xattr_handler ext3_xattr_acl_default_handler;
65   -extern struct xattr_handler ext3_xattr_security_handler;
  61 +extern const struct xattr_handler ext3_xattr_user_handler;
  62 +extern const struct xattr_handler ext3_xattr_trusted_handler;
  63 +extern const struct xattr_handler ext3_xattr_acl_access_handler;
  64 +extern const struct xattr_handler ext3_xattr_acl_default_handler;
  65 +extern const struct xattr_handler ext3_xattr_security_handler;
66 66  
67 67 extern ssize_t ext3_listxattr(struct dentry *, char *, size_t);
68 68  
... ... @@ -76,7 +76,7 @@
76 76 extern int init_ext3_xattr(void);
77 77 extern void exit_ext3_xattr(void);
78 78  
79   -extern struct xattr_handler *ext3_xattr_handlers[];
  79 +extern const struct xattr_handler *ext3_xattr_handlers[];
80 80  
81 81 # else /* CONFIG_EXT3_FS_XATTR */
82 82  
fs/ext3/xattr_security.c
... ... @@ -69,7 +69,7 @@
69 69 return err;
70 70 }
71 71  
72   -struct xattr_handler ext3_xattr_security_handler = {
  72 +const struct xattr_handler ext3_xattr_security_handler = {
73 73 .prefix = XATTR_SECURITY_PREFIX,
74 74 .list = ext3_xattr_security_list,
75 75 .get = ext3_xattr_security_get,
fs/ext3/xattr_trusted.c
... ... @@ -51,7 +51,7 @@
51 51 value, size, flags);
52 52 }
53 53  
54   -struct xattr_handler ext3_xattr_trusted_handler = {
  54 +const struct xattr_handler ext3_xattr_trusted_handler = {
55 55 .prefix = XATTR_TRUSTED_PREFIX,
56 56 .list = ext3_xattr_trusted_list,
57 57 .get = ext3_xattr_trusted_get,
fs/ext3/xattr_user.c
... ... @@ -54,7 +54,7 @@
54 54 name, value, size, flags);
55 55 }
56 56  
57   -struct xattr_handler ext3_xattr_user_handler = {
  57 +const struct xattr_handler ext3_xattr_user_handler = {
58 58 .prefix = XATTR_USER_PREFIX,
59 59 .list = ext3_xattr_user_list,
60 60 .get = ext3_xattr_user_get,