Commit 11e27528076e7dee63f1db78bffbef6310f076f4

Authored by Stephen Hemminger
Committed by Al Viro
1 parent d1f21049f9

ext4: constify xattr_handler

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

... ... @@ -454,7 +454,7 @@
454 454 return error;
455 455 }
456 456  
457   -struct xattr_handler ext4_xattr_acl_access_handler = {
  457 +const struct xattr_handler ext4_xattr_acl_access_handler = {
458 458 .prefix = POSIX_ACL_XATTR_ACCESS,
459 459 .flags = ACL_TYPE_ACCESS,
460 460 .list = ext4_xattr_list_acl_access,
... ... @@ -462,7 +462,7 @@
462 462 .set = ext4_xattr_set_acl,
463 463 };
464 464  
465   -struct xattr_handler ext4_xattr_acl_default_handler = {
  465 +const struct xattr_handler ext4_xattr_acl_default_handler = {
466 466 .prefix = POSIX_ACL_XATTR_DEFAULT,
467 467 .flags = ACL_TYPE_DEFAULT,
468 468 .list = ext4_xattr_list_acl_default,
... ... @@ -97,7 +97,7 @@
97 97  
98 98 static struct mb_cache *ext4_xattr_cache;
99 99  
100   -static struct xattr_handler *ext4_xattr_handler_map[] = {
  100 +static const struct xattr_handler *ext4_xattr_handler_map[] = {
101 101 [EXT4_XATTR_INDEX_USER] = &ext4_xattr_user_handler,
102 102 #ifdef CONFIG_EXT4_FS_POSIX_ACL
103 103 [EXT4_XATTR_INDEX_POSIX_ACL_ACCESS] = &ext4_xattr_acl_access_handler,
... ... @@ -109,7 +109,7 @@
109 109 #endif
110 110 };
111 111  
112   -struct xattr_handler *ext4_xattr_handlers[] = {
  112 +const struct xattr_handler *ext4_xattr_handlers[] = {
113 113 &ext4_xattr_user_handler,
114 114 &ext4_xattr_trusted_handler,
115 115 #ifdef CONFIG_EXT4_FS_POSIX_ACL
116 116  
... ... @@ -122,10 +122,10 @@
122 122 NULL
123 123 };
124 124  
125   -static inline struct xattr_handler *
  125 +static inline const struct xattr_handler *
126 126 ext4_xattr_handler(int name_index)
127 127 {
128   - struct xattr_handler *handler = NULL;
  128 + const struct xattr_handler *handler = NULL;
129 129  
130 130 if (name_index > 0 && name_index < ARRAY_SIZE(ext4_xattr_handler_map))
131 131 handler = ext4_xattr_handler_map[name_index];
... ... @@ -332,7 +332,7 @@
332 332 size_t rest = buffer_size;
333 333  
334 334 for (; !IS_LAST_ENTRY(entry); entry = EXT4_XATTR_NEXT(entry)) {
335   - struct xattr_handler *handler =
  335 + const struct xattr_handler *handler =
336 336 ext4_xattr_handler(entry->e_name_index);
337 337  
338 338 if (handler) {
... ... @@ -65,11 +65,11 @@
65 65  
66 66 # ifdef CONFIG_EXT4_FS_XATTR
67 67  
68   -extern struct xattr_handler ext4_xattr_user_handler;
69   -extern struct xattr_handler ext4_xattr_trusted_handler;
70   -extern struct xattr_handler ext4_xattr_acl_access_handler;
71   -extern struct xattr_handler ext4_xattr_acl_default_handler;
72   -extern struct xattr_handler ext4_xattr_security_handler;
  68 +extern const struct xattr_handler ext4_xattr_user_handler;
  69 +extern const struct xattr_handler ext4_xattr_trusted_handler;
  70 +extern const struct xattr_handler ext4_xattr_acl_access_handler;
  71 +extern const struct xattr_handler ext4_xattr_acl_default_handler;
  72 +extern const struct xattr_handler ext4_xattr_security_handler;
73 73  
74 74 extern ssize_t ext4_listxattr(struct dentry *, char *, size_t);
75 75  
... ... @@ -86,7 +86,7 @@
86 86 extern int init_ext4_xattr(void);
87 87 extern void exit_ext4_xattr(void);
88 88  
89   -extern struct xattr_handler *ext4_xattr_handlers[];
  89 +extern const struct xattr_handler *ext4_xattr_handlers[];
90 90  
91 91 # else /* CONFIG_EXT4_FS_XATTR */
92 92  
fs/ext4/xattr_security.c
... ... @@ -69,7 +69,7 @@
69 69 return err;
70 70 }
71 71  
72   -struct xattr_handler ext4_xattr_security_handler = {
  72 +const struct xattr_handler ext4_xattr_security_handler = {
73 73 .prefix = XATTR_SECURITY_PREFIX,
74 74 .list = ext4_xattr_security_list,
75 75 .get = ext4_xattr_security_get,
fs/ext4/xattr_trusted.c
... ... @@ -51,7 +51,7 @@
51 51 name, value, size, flags);
52 52 }
53 53  
54   -struct xattr_handler ext4_xattr_trusted_handler = {
  54 +const struct xattr_handler ext4_xattr_trusted_handler = {
55 55 .prefix = XATTR_TRUSTED_PREFIX,
56 56 .list = ext4_xattr_trusted_list,
57 57 .get = ext4_xattr_trusted_get,
fs/ext4/xattr_user.c
... ... @@ -54,7 +54,7 @@
54 54 name, value, size, flags);
55 55 }
56 56  
57   -struct xattr_handler ext4_xattr_user_handler = {
  57 +const struct xattr_handler ext4_xattr_user_handler = {
58 58 .prefix = XATTR_USER_PREFIX,
59 59 .list = ext4_xattr_user_list,
60 60 .get = ext4_xattr_user_get,