Gao Xiang | 29b24f6 | 2019-07-31 23:57:31 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 2 | /* |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 3 | * Copyright (C) 2017-2018 HUAWEI, Inc. |
| 4 | * http://www.huawei.com/ |
| 5 | * Created by Gao Xiang <gaoxiang25@huawei.com> |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 6 | */ |
| 7 | #include <linux/module.h> |
| 8 | #include <linux/buffer_head.h> |
| 9 | #include <linux/statfs.h> |
| 10 | #include <linux/parser.h> |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 11 | #include <linux/seq_file.h> |
Gao Xiang | 6af7b48 | 2019-01-14 19:40:25 +0800 | [diff] [blame] | 12 | #include "xattr.h" |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 13 | |
Chao Yu | 13f06f4 | 2018-07-26 20:21:55 +0800 | [diff] [blame] | 14 | #define CREATE_TRACE_POINTS |
| 15 | #include <trace/events/erofs.h> |
| 16 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 17 | static struct kmem_cache *erofs_inode_cachep __read_mostly; |
| 18 | |
| 19 | static void init_once(void *ptr) |
| 20 | { |
| 21 | struct erofs_vnode *vi = ptr; |
| 22 | |
| 23 | inode_init_once(&vi->vfs_inode); |
| 24 | } |
| 25 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 26 | static struct inode *alloc_inode(struct super_block *sb) |
| 27 | { |
| 28 | struct erofs_vnode *vi = |
| 29 | kmem_cache_alloc(erofs_inode_cachep, GFP_KERNEL); |
| 30 | |
Vatsala Narang | e2ff9f1 | 2019-03-21 05:36:13 +0530 | [diff] [blame] | 31 | if (!vi) |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 32 | return NULL; |
| 33 | |
| 34 | /* zero out everything except vfs_inode */ |
| 35 | memset(vi, 0, offsetof(struct erofs_vnode, vfs_inode)); |
| 36 | return &vi->vfs_inode; |
| 37 | } |
| 38 | |
Al Viro | 25af6c4 | 2019-04-10 14:59:08 -0400 | [diff] [blame] | 39 | static void free_inode(struct inode *inode) |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 40 | { |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 41 | struct erofs_vnode *vi = EROFS_V(inode); |
| 42 | |
| 43 | /* be careful RCU symlink path (see ext4_inode_info->i_data)! */ |
| 44 | if (is_inode_fast_symlink(inode)) |
| 45 | kfree(inode->i_link); |
| 46 | |
| 47 | kfree(vi->xattr_shared_xattrs); |
| 48 | |
| 49 | kmem_cache_free(erofs_inode_cachep, vi); |
| 50 | } |
| 51 | |
Gao Xiang | 5efe513 | 2019-06-13 16:35:41 +0800 | [diff] [blame] | 52 | static bool check_layout_compatibility(struct super_block *sb, |
| 53 | struct erofs_super_block *layout) |
| 54 | { |
Gao Xiang | 426a930 | 2019-09-04 10:08:53 +0800 | [diff] [blame] | 55 | const unsigned int feature = le32_to_cpu(layout->feature_incompat); |
Gao Xiang | 5efe513 | 2019-06-13 16:35:41 +0800 | [diff] [blame] | 56 | |
Gao Xiang | 426a930 | 2019-09-04 10:08:53 +0800 | [diff] [blame] | 57 | EROFS_SB(sb)->feature_incompat = feature; |
Gao Xiang | 5efe513 | 2019-06-13 16:35:41 +0800 | [diff] [blame] | 58 | |
| 59 | /* check if current kernel meets all mandatory requirements */ |
Gao Xiang | 426a930 | 2019-09-04 10:08:53 +0800 | [diff] [blame] | 60 | if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) { |
| 61 | errln("unidentified incompatible feature %x, please upgrade kernel version", |
| 62 | feature & ~EROFS_ALL_FEATURE_INCOMPAT); |
Gao Xiang | 5efe513 | 2019-06-13 16:35:41 +0800 | [diff] [blame] | 63 | return false; |
| 64 | } |
| 65 | return true; |
| 66 | } |
| 67 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 68 | static int superblock_read(struct super_block *sb) |
| 69 | { |
| 70 | struct erofs_sb_info *sbi; |
| 71 | struct buffer_head *bh; |
| 72 | struct erofs_super_block *layout; |
Thomas Weißschuh | 7dd68b1 | 2018-09-10 21:41:14 +0200 | [diff] [blame] | 73 | unsigned int blkszbits; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 74 | int ret; |
| 75 | |
| 76 | bh = sb_bread(sb, 0); |
| 77 | |
Vatsala Narang | e2ff9f1 | 2019-03-21 05:36:13 +0530 | [diff] [blame] | 78 | if (!bh) { |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 79 | errln("cannot read erofs superblock"); |
| 80 | return -EIO; |
| 81 | } |
| 82 | |
| 83 | sbi = EROFS_SB(sb); |
| 84 | layout = (struct erofs_super_block *)((u8 *)bh->b_data |
| 85 | + EROFS_SUPER_OFFSET); |
| 86 | |
| 87 | ret = -EINVAL; |
| 88 | if (le32_to_cpu(layout->magic) != EROFS_SUPER_MAGIC_V1) { |
| 89 | errln("cannot find valid erofs superblock"); |
| 90 | goto out; |
| 91 | } |
| 92 | |
| 93 | blkszbits = layout->blkszbits; |
| 94 | /* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */ |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 95 | if (blkszbits != LOG_BLOCK_SIZE) { |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 96 | errln("blksize %u isn't supported on this platform", |
Julian Merida | 447a362 | 2019-03-18 20:58:41 -0300 | [diff] [blame] | 97 | 1 << blkszbits); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 98 | goto out; |
| 99 | } |
| 100 | |
Gao Xiang | 5efe513 | 2019-06-13 16:35:41 +0800 | [diff] [blame] | 101 | if (!check_layout_compatibility(sb, layout)) |
| 102 | goto out; |
| 103 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 104 | sbi->blocks = le32_to_cpu(layout->blocks); |
| 105 | sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 106 | #ifdef CONFIG_EROFS_FS_XATTR |
| 107 | sbi->xattr_blkaddr = le32_to_cpu(layout->xattr_blkaddr); |
| 108 | #endif |
Gao Xiang | 8a76568 | 2019-09-04 10:08:54 +0800 | [diff] [blame] | 109 | sbi->islotbits = ilog2(sizeof(struct erofs_inode_compact)); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 110 | sbi->root_nid = le16_to_cpu(layout->root_nid); |
| 111 | sbi->inos = le64_to_cpu(layout->inos); |
| 112 | |
| 113 | sbi->build_time = le64_to_cpu(layout->build_time); |
| 114 | sbi->build_time_nsec = le32_to_cpu(layout->build_time_nsec); |
| 115 | |
| 116 | memcpy(&sb->s_uuid, layout->uuid, sizeof(layout->uuid)); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 117 | |
Gao Xiang | a64d949 | 2019-08-18 18:28:24 +0800 | [diff] [blame] | 118 | ret = strscpy(sbi->volume_name, layout->volume_name, |
| 119 | sizeof(layout->volume_name)); |
| 120 | if (ret < 0) { /* -E2BIG */ |
| 121 | errln("bad volume name without NIL terminator"); |
| 122 | ret = -EFSCORRUPTED; |
| 123 | goto out; |
| 124 | } |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 125 | ret = 0; |
| 126 | out: |
| 127 | brelse(bh); |
| 128 | return ret; |
| 129 | } |
| 130 | |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 131 | #ifdef CONFIG_EROFS_FAULT_INJECTION |
Gao Xiang | 14a56ec | 2019-03-25 11:40:09 +0800 | [diff] [blame] | 132 | const char *erofs_fault_name[FAULT_MAX] = { |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 133 | [FAULT_KMALLOC] = "kmalloc", |
Gao Xiang | 14a56ec | 2019-03-25 11:40:09 +0800 | [diff] [blame] | 134 | [FAULT_READ_IO] = "read IO error", |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 135 | }; |
| 136 | |
Chengguang Xu | d41076e | 2018-09-19 22:53:46 +0800 | [diff] [blame] | 137 | static void __erofs_build_fault_attr(struct erofs_sb_info *sbi, |
| 138 | unsigned int rate) |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 139 | { |
| 140 | struct erofs_fault_info *ffi = &sbi->fault_info; |
| 141 | |
| 142 | if (rate) { |
| 143 | atomic_set(&ffi->inject_ops, 0); |
| 144 | ffi->inject_rate = rate; |
| 145 | ffi->inject_type = (1 << FAULT_MAX) - 1; |
| 146 | } else { |
| 147 | memset(ffi, 0, sizeof(struct erofs_fault_info)); |
| 148 | } |
Chengguang Xu | 01e4ae4 | 2018-09-19 22:53:44 +0800 | [diff] [blame] | 149 | |
| 150 | set_opt(sbi, FAULT_INJECTION); |
Chengguang Xu | d41076e | 2018-09-19 22:53:46 +0800 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | static int erofs_build_fault_attr(struct erofs_sb_info *sbi, |
| 154 | substring_t *args) |
| 155 | { |
| 156 | int rate = 0; |
| 157 | |
| 158 | if (args->from && match_int(args, &rate)) |
| 159 | return -EINVAL; |
| 160 | |
| 161 | __erofs_build_fault_attr(sbi, rate); |
Chengguang Xu | 01e4ae4 | 2018-09-19 22:53:44 +0800 | [diff] [blame] | 162 | return 0; |
| 163 | } |
Chengguang Xu | 2ab3dd8 | 2018-09-19 22:53:45 +0800 | [diff] [blame] | 164 | |
| 165 | static unsigned int erofs_get_fault_rate(struct erofs_sb_info *sbi) |
| 166 | { |
| 167 | return sbi->fault_info.inject_rate; |
| 168 | } |
Chengguang Xu | 01e4ae4 | 2018-09-19 22:53:44 +0800 | [diff] [blame] | 169 | #else |
Chengguang Xu | d41076e | 2018-09-19 22:53:46 +0800 | [diff] [blame] | 170 | static void __erofs_build_fault_attr(struct erofs_sb_info *sbi, |
| 171 | unsigned int rate) |
| 172 | { |
| 173 | } |
| 174 | |
Chengguang Xu | 01e4ae4 | 2018-09-19 22:53:44 +0800 | [diff] [blame] | 175 | static int erofs_build_fault_attr(struct erofs_sb_info *sbi, |
| 176 | substring_t *args) |
| 177 | { |
| 178 | infoln("fault_injection options not supported"); |
| 179 | return 0; |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 180 | } |
Chengguang Xu | 2ab3dd8 | 2018-09-19 22:53:45 +0800 | [diff] [blame] | 181 | |
| 182 | static unsigned int erofs_get_fault_rate(struct erofs_sb_info *sbi) |
| 183 | { |
| 184 | return 0; |
| 185 | } |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 186 | #endif |
| 187 | |
Gao Xiang | 5fb76bb | 2018-09-20 00:06:56 +0800 | [diff] [blame] | 188 | #ifdef CONFIG_EROFS_FS_ZIP |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 189 | static int erofs_build_cache_strategy(struct erofs_sb_info *sbi, |
| 190 | substring_t *args) |
| 191 | { |
| 192 | const char *cs = match_strdup(args); |
| 193 | int err = 0; |
| 194 | |
| 195 | if (!cs) { |
| 196 | errln("Not enough memory to store cache strategy"); |
| 197 | return -ENOMEM; |
| 198 | } |
| 199 | |
| 200 | if (!strcmp(cs, "disabled")) { |
| 201 | sbi->cache_strategy = EROFS_ZIP_CACHE_DISABLED; |
| 202 | } else if (!strcmp(cs, "readahead")) { |
| 203 | sbi->cache_strategy = EROFS_ZIP_CACHE_READAHEAD; |
| 204 | } else if (!strcmp(cs, "readaround")) { |
| 205 | sbi->cache_strategy = EROFS_ZIP_CACHE_READAROUND; |
| 206 | } else { |
| 207 | errln("Unrecognized cache strategy \"%s\"", cs); |
| 208 | err = -EINVAL; |
| 209 | } |
| 210 | kfree(cs); |
| 211 | return err; |
| 212 | } |
| 213 | #else |
| 214 | static int erofs_build_cache_strategy(struct erofs_sb_info *sbi, |
| 215 | substring_t *args) |
| 216 | { |
| 217 | infoln("EROFS compression is disabled, so cache strategy is ignored"); |
| 218 | return 0; |
| 219 | } |
Gao Xiang | 5fb76bb | 2018-09-20 00:06:56 +0800 | [diff] [blame] | 220 | #endif |
| 221 | |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 222 | /* set up default EROFS parameters */ |
| 223 | static void default_options(struct erofs_sb_info *sbi) |
| 224 | { |
| 225 | #ifdef CONFIG_EROFS_FS_ZIP |
| 226 | sbi->cache_strategy = EROFS_ZIP_CACHE_READAROUND; |
| 227 | sbi->max_sync_decompress_pages = 3; |
| 228 | #endif |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 229 | #ifdef CONFIG_EROFS_FS_XATTR |
| 230 | set_opt(sbi, XATTR_USER); |
| 231 | #endif |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 232 | #ifdef CONFIG_EROFS_FS_POSIX_ACL |
| 233 | set_opt(sbi, POSIX_ACL); |
| 234 | #endif |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | enum { |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 238 | Opt_user_xattr, |
| 239 | Opt_nouser_xattr, |
| 240 | Opt_acl, |
| 241 | Opt_noacl, |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 242 | Opt_fault_injection, |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 243 | Opt_cache_strategy, |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 244 | Opt_err |
| 245 | }; |
| 246 | |
| 247 | static match_table_t erofs_tokens = { |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 248 | {Opt_user_xattr, "user_xattr"}, |
| 249 | {Opt_nouser_xattr, "nouser_xattr"}, |
| 250 | {Opt_acl, "acl"}, |
| 251 | {Opt_noacl, "noacl"}, |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 252 | {Opt_fault_injection, "fault_injection=%u"}, |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 253 | {Opt_cache_strategy, "cache_strategy=%s"}, |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 254 | {Opt_err, NULL} |
| 255 | }; |
| 256 | |
| 257 | static int parse_options(struct super_block *sb, char *options) |
| 258 | { |
| 259 | substring_t args[MAX_OPT_ARGS]; |
| 260 | char *p; |
Chengguang Xu | 01e4ae4 | 2018-09-19 22:53:44 +0800 | [diff] [blame] | 261 | int err; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 262 | |
| 263 | if (!options) |
| 264 | return 0; |
| 265 | |
Bhanusree Pola | 561fb35 | 2019-03-22 10:38:16 +0800 | [diff] [blame] | 266 | while ((p = strsep(&options, ","))) { |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 267 | int token; |
| 268 | |
| 269 | if (!*p) |
| 270 | continue; |
| 271 | |
| 272 | args[0].to = args[0].from = NULL; |
| 273 | token = match_token(p, erofs_tokens, args); |
| 274 | |
| 275 | switch (token) { |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 276 | #ifdef CONFIG_EROFS_FS_XATTR |
| 277 | case Opt_user_xattr: |
| 278 | set_opt(EROFS_SB(sb), XATTR_USER); |
| 279 | break; |
| 280 | case Opt_nouser_xattr: |
| 281 | clear_opt(EROFS_SB(sb), XATTR_USER); |
| 282 | break; |
| 283 | #else |
| 284 | case Opt_user_xattr: |
| 285 | infoln("user_xattr options not supported"); |
| 286 | break; |
| 287 | case Opt_nouser_xattr: |
| 288 | infoln("nouser_xattr options not supported"); |
| 289 | break; |
| 290 | #endif |
| 291 | #ifdef CONFIG_EROFS_FS_POSIX_ACL |
| 292 | case Opt_acl: |
| 293 | set_opt(EROFS_SB(sb), POSIX_ACL); |
| 294 | break; |
| 295 | case Opt_noacl: |
| 296 | clear_opt(EROFS_SB(sb), POSIX_ACL); |
| 297 | break; |
| 298 | #else |
| 299 | case Opt_acl: |
| 300 | infoln("acl options not supported"); |
| 301 | break; |
| 302 | case Opt_noacl: |
| 303 | infoln("noacl options not supported"); |
| 304 | break; |
| 305 | #endif |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 306 | case Opt_fault_injection: |
Chengguang Xu | 01e4ae4 | 2018-09-19 22:53:44 +0800 | [diff] [blame] | 307 | err = erofs_build_fault_attr(EROFS_SB(sb), args); |
| 308 | if (err) |
| 309 | return err; |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 310 | break; |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 311 | case Opt_cache_strategy: |
| 312 | err = erofs_build_cache_strategy(EROFS_SB(sb), args); |
| 313 | if (err) |
| 314 | return err; |
| 315 | break; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 316 | default: |
Gao Xiang | bc33d9f | 2019-07-31 23:57:51 +0800 | [diff] [blame] | 317 | errln("Unrecognized mount option \"%s\" or missing value", p); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 318 | return -EINVAL; |
| 319 | } |
| 320 | } |
| 321 | return 0; |
| 322 | } |
| 323 | |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 324 | #ifdef CONFIG_EROFS_FS_ZIP |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 325 | static const struct address_space_operations managed_cache_aops; |
| 326 | |
| 327 | static int managed_cache_releasepage(struct page *page, gfp_t gfp_mask) |
| 328 | { |
| 329 | int ret = 1; /* 0 - busy */ |
| 330 | struct address_space *const mapping = page->mapping; |
| 331 | |
Gao Xiang | 8b987bc | 2018-12-05 21:23:13 +0800 | [diff] [blame] | 332 | DBG_BUGON(!PageLocked(page)); |
| 333 | DBG_BUGON(mapping->a_ops != &managed_cache_aops); |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 334 | |
| 335 | if (PagePrivate(page)) |
Gao Xiang | 47e541a | 2018-07-29 13:34:58 +0800 | [diff] [blame] | 336 | ret = erofs_try_to_free_cached_page(mapping, page); |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 337 | |
| 338 | return ret; |
| 339 | } |
| 340 | |
| 341 | static void managed_cache_invalidatepage(struct page *page, |
Julian Merida | 447a362 | 2019-03-18 20:58:41 -0300 | [diff] [blame] | 342 | unsigned int offset, |
| 343 | unsigned int length) |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 344 | { |
| 345 | const unsigned int stop = length + offset; |
| 346 | |
Gao Xiang | 8b987bc | 2018-12-05 21:23:13 +0800 | [diff] [blame] | 347 | DBG_BUGON(!PageLocked(page)); |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 348 | |
Gao Xiang | 8b987bc | 2018-12-05 21:23:13 +0800 | [diff] [blame] | 349 | /* Check for potential overflow in debug mode */ |
| 350 | DBG_BUGON(stop > PAGE_SIZE || stop < length); |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 351 | |
| 352 | if (offset == 0 && stop == PAGE_SIZE) |
| 353 | while (!managed_cache_releasepage(page, GFP_NOFS)) |
| 354 | cond_resched(); |
| 355 | } |
| 356 | |
| 357 | static const struct address_space_operations managed_cache_aops = { |
| 358 | .releasepage = managed_cache_releasepage, |
| 359 | .invalidatepage = managed_cache_invalidatepage, |
| 360 | }; |
| 361 | |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 362 | static int erofs_init_managed_cache(struct super_block *sb) |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 363 | { |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 364 | struct erofs_sb_info *const sbi = EROFS_SB(sb); |
| 365 | struct inode *const inode = new_inode(sb); |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 366 | |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 367 | if (!inode) |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 368 | return -ENOMEM; |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 369 | |
| 370 | set_nlink(inode, 1); |
| 371 | inode->i_size = OFFSET_MAX; |
| 372 | |
| 373 | inode->i_mapping->a_ops = &managed_cache_aops; |
| 374 | mapping_set_gfp_mask(inode->i_mapping, |
Gao Xiang | 8494c29 | 2019-07-31 23:57:42 +0800 | [diff] [blame] | 375 | GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE); |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 376 | sbi->managed_cache = inode; |
| 377 | return 0; |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 378 | } |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 379 | #else |
| 380 | static int erofs_init_managed_cache(struct super_block *sb) { return 0; } |
Gao Xiang | 105d4ad | 2018-07-26 20:22:07 +0800 | [diff] [blame] | 381 | #endif |
| 382 | |
Gao Xiang | 9e794de | 2019-07-31 23:57:40 +0800 | [diff] [blame] | 383 | static int erofs_fill_super(struct super_block *sb, void *data, int silent) |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 384 | { |
| 385 | struct inode *inode; |
| 386 | struct erofs_sb_info *sbi; |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 387 | int err; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 388 | |
Gao Xiang | 9e794de | 2019-07-31 23:57:40 +0800 | [diff] [blame] | 389 | infoln("fill_super, device -> %s", sb->s_id); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 390 | infoln("options -> %s", (char *)data); |
| 391 | |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 392 | sb->s_magic = EROFS_SUPER_MAGIC; |
| 393 | |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 394 | if (!sb_set_blocksize(sb, EROFS_BLKSIZ)) { |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 395 | errln("failed to set erofs blksize"); |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 396 | return -EINVAL; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 397 | } |
| 398 | |
Shobhit Kukreti | a9f69bd | 2019-06-26 22:31:18 -0700 | [diff] [blame] | 399 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 400 | if (!sbi) |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 401 | return -ENOMEM; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 402 | |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 403 | sb->s_fs_info = sbi; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 404 | err = superblock_read(sb); |
| 405 | if (err) |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 406 | return err; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 407 | |
Gao Xiang | 5f0abea | 2018-09-06 17:01:47 +0800 | [diff] [blame] | 408 | sb->s_flags |= SB_RDONLY | SB_NOATIME; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 409 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
| 410 | sb->s_time_gran = 1; |
| 411 | |
| 412 | sb->s_op = &erofs_sops; |
| 413 | |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 414 | #ifdef CONFIG_EROFS_FS_XATTR |
| 415 | sb->s_xattr = erofs_xattr_handlers; |
| 416 | #endif |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 417 | /* set erofs default mount options */ |
| 418 | default_options(sbi); |
| 419 | |
| 420 | err = parse_options(sb, data); |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 421 | if (err) |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 422 | return err; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 423 | |
| 424 | if (!silent) |
| 425 | infoln("root inode @ nid %llu", ROOT_NID(sbi)); |
| 426 | |
Gao Xiang | 516c115c | 2019-01-29 16:35:20 +0800 | [diff] [blame] | 427 | if (test_opt(sbi, POSIX_ACL)) |
| 428 | sb->s_flags |= SB_POSIXACL; |
| 429 | else |
| 430 | sb->s_flags &= ~SB_POSIXACL; |
| 431 | |
Gao Xiang | e7e9a30 | 2018-07-26 20:22:05 +0800 | [diff] [blame] | 432 | #ifdef CONFIG_EROFS_FS_ZIP |
| 433 | INIT_RADIX_TREE(&sbi->workstn_tree, GFP_ATOMIC); |
| 434 | #endif |
| 435 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 436 | /* get the root inode */ |
| 437 | inode = erofs_iget(sb, ROOT_NID(sbi), true); |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 438 | if (IS_ERR(inode)) |
| 439 | return PTR_ERR(inode); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 440 | |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 441 | if (!S_ISDIR(inode->i_mode)) { |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 442 | errln("rootino(nid %llu) is not a directory(i_mode %o)", |
Julian Merida | 447a362 | 2019-03-18 20:58:41 -0300 | [diff] [blame] | 443 | ROOT_NID(sbi), inode->i_mode); |
Chengguang Xu | 94832d9 | 2019-01-23 14:12:25 +0800 | [diff] [blame] | 444 | iput(inode); |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 445 | return -EINVAL; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 446 | } |
| 447 | |
| 448 | sb->s_root = d_make_root(inode); |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 449 | if (!sb->s_root) |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 450 | return -ENOMEM; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 451 | |
Gao Xiang | 22fe04a | 2019-07-31 23:57:39 +0800 | [diff] [blame] | 452 | erofs_shrinker_register(sb); |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 453 | /* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ |
| 454 | err = erofs_init_managed_cache(sb); |
Gao Xiang | 8d8a09b | 2019-08-30 00:38:27 +0800 | [diff] [blame] | 455 | if (err) |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 456 | return err; |
Gao Xiang | 2497ee4 | 2018-07-26 20:22:03 +0800 | [diff] [blame] | 457 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 458 | if (!silent) |
Gao Xiang | 9e794de | 2019-07-31 23:57:40 +0800 | [diff] [blame] | 459 | infoln("mounted on %s with opts: %s.", sb->s_id, (char *)data); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 460 | return 0; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 461 | } |
| 462 | |
Gao Xiang | 9e794de | 2019-07-31 23:57:40 +0800 | [diff] [blame] | 463 | static struct dentry *erofs_mount(struct file_system_type *fs_type, int flags, |
| 464 | const char *dev_name, void *data) |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 465 | { |
Gao Xiang | 9e794de | 2019-07-31 23:57:40 +0800 | [diff] [blame] | 466 | return mount_bdev(fs_type, flags, dev_name, data, erofs_fill_super); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 467 | } |
| 468 | |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 469 | /* |
| 470 | * could be triggered after deactivate_locked_super() |
| 471 | * is called, thus including umount and failed to initialize. |
| 472 | */ |
| 473 | static void erofs_kill_sb(struct super_block *sb) |
| 474 | { |
| 475 | struct erofs_sb_info *sbi; |
| 476 | |
| 477 | WARN_ON(sb->s_magic != EROFS_SUPER_MAGIC); |
| 478 | infoln("unmounting for %s", sb->s_id); |
| 479 | |
| 480 | kill_block_super(sb); |
| 481 | |
| 482 | sbi = EROFS_SB(sb); |
| 483 | if (!sbi) |
| 484 | return; |
| 485 | kfree(sbi); |
| 486 | sb->s_fs_info = NULL; |
| 487 | } |
| 488 | |
| 489 | /* called when ->s_root is non-NULL */ |
| 490 | static void erofs_put_super(struct super_block *sb) |
| 491 | { |
| 492 | struct erofs_sb_info *const sbi = EROFS_SB(sb); |
| 493 | |
| 494 | DBG_BUGON(!sbi); |
| 495 | |
| 496 | erofs_shrinker_unregister(sb); |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 497 | #ifdef CONFIG_EROFS_FS_ZIP |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 498 | iput(sbi->managed_cache); |
| 499 | sbi->managed_cache = NULL; |
| 500 | #endif |
| 501 | } |
| 502 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 503 | static struct file_system_type erofs_fs_type = { |
| 504 | .owner = THIS_MODULE, |
| 505 | .name = "erofs", |
| 506 | .mount = erofs_mount, |
Gao Xiang | 8f7acda | 2019-07-31 23:57:41 +0800 | [diff] [blame] | 507 | .kill_sb = erofs_kill_sb, |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 508 | .fs_flags = FS_REQUIRES_DEV, |
| 509 | }; |
| 510 | MODULE_ALIAS_FS("erofs"); |
| 511 | |
| 512 | static int __init erofs_module_init(void) |
| 513 | { |
| 514 | int err; |
| 515 | |
| 516 | erofs_check_ondisk_layout_definitions(); |
| 517 | infoln("initializing erofs " EROFS_VERSION); |
| 518 | |
Gao Xiang | 1c2dfbf | 2019-09-04 10:08:55 +0800 | [diff] [blame^] | 519 | erofs_inode_cachep = kmem_cache_create("erofs_inode", |
| 520 | sizeof(struct erofs_vnode), 0, |
| 521 | SLAB_RECLAIM_ACCOUNT, |
| 522 | init_once); |
| 523 | if (!erofs_inode_cachep) { |
| 524 | err = -ENOMEM; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 525 | goto icache_err; |
Gao Xiang | 1c2dfbf | 2019-09-04 10:08:55 +0800 | [diff] [blame^] | 526 | } |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 527 | |
Gao Xiang | 22fe04a | 2019-07-31 23:57:39 +0800 | [diff] [blame] | 528 | err = erofs_init_shrinker(); |
Gao Xiang | a158131 | 2018-07-26 20:22:04 +0800 | [diff] [blame] | 529 | if (err) |
| 530 | goto shrinker_err; |
| 531 | |
Gao Xiang | 3883a79 | 2018-07-26 20:22:06 +0800 | [diff] [blame] | 532 | err = z_erofs_init_zip_subsystem(); |
| 533 | if (err) |
| 534 | goto zip_err; |
Gao Xiang | 3883a79 | 2018-07-26 20:22:06 +0800 | [diff] [blame] | 535 | |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 536 | err = register_filesystem(&erofs_fs_type); |
| 537 | if (err) |
| 538 | goto fs_err; |
| 539 | |
| 540 | infoln("successfully to initialize erofs"); |
| 541 | return 0; |
| 542 | |
| 543 | fs_err: |
Gao Xiang | 3883a79 | 2018-07-26 20:22:06 +0800 | [diff] [blame] | 544 | z_erofs_exit_zip_subsystem(); |
| 545 | zip_err: |
Gao Xiang | 22fe04a | 2019-07-31 23:57:39 +0800 | [diff] [blame] | 546 | erofs_exit_shrinker(); |
Gao Xiang | a158131 | 2018-07-26 20:22:04 +0800 | [diff] [blame] | 547 | shrinker_err: |
Gao Xiang | 1c2dfbf | 2019-09-04 10:08:55 +0800 | [diff] [blame^] | 548 | kmem_cache_destroy(erofs_inode_cachep); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 549 | icache_err: |
| 550 | return err; |
| 551 | } |
| 552 | |
| 553 | static void __exit erofs_module_exit(void) |
| 554 | { |
| 555 | unregister_filesystem(&erofs_fs_type); |
Gao Xiang | 3883a79 | 2018-07-26 20:22:06 +0800 | [diff] [blame] | 556 | z_erofs_exit_zip_subsystem(); |
Gao Xiang | 22fe04a | 2019-07-31 23:57:39 +0800 | [diff] [blame] | 557 | erofs_exit_shrinker(); |
Gao Xiang | 1c2dfbf | 2019-09-04 10:08:55 +0800 | [diff] [blame^] | 558 | |
| 559 | /* Ensure all RCU free inodes are safe before cache is destroyed. */ |
| 560 | rcu_barrier(); |
| 561 | kmem_cache_destroy(erofs_inode_cachep); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 562 | infoln("successfully finalize erofs"); |
| 563 | } |
| 564 | |
| 565 | /* get filesystem statistics */ |
| 566 | static int erofs_statfs(struct dentry *dentry, struct kstatfs *buf) |
| 567 | { |
| 568 | struct super_block *sb = dentry->d_sb; |
| 569 | struct erofs_sb_info *sbi = EROFS_SB(sb); |
| 570 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); |
| 571 | |
| 572 | buf->f_type = sb->s_magic; |
| 573 | buf->f_bsize = EROFS_BLKSIZ; |
| 574 | buf->f_blocks = sbi->blocks; |
| 575 | buf->f_bfree = buf->f_bavail = 0; |
| 576 | |
| 577 | buf->f_files = ULLONG_MAX; |
| 578 | buf->f_ffree = ULLONG_MAX - sbi->inos; |
| 579 | |
| 580 | buf->f_namelen = EROFS_NAME_LEN; |
| 581 | |
| 582 | buf->f_fsid.val[0] = (u32)id; |
| 583 | buf->f_fsid.val[1] = (u32)(id >> 32); |
| 584 | return 0; |
| 585 | } |
| 586 | |
| 587 | static int erofs_show_options(struct seq_file *seq, struct dentry *root) |
| 588 | { |
Gao Xiang | b17500a | 2018-07-26 20:21:52 +0800 | [diff] [blame] | 589 | struct erofs_sb_info *sbi __maybe_unused = EROFS_SB(root->d_sb); |
| 590 | |
| 591 | #ifdef CONFIG_EROFS_FS_XATTR |
| 592 | if (test_opt(sbi, XATTR_USER)) |
| 593 | seq_puts(seq, ",user_xattr"); |
| 594 | else |
| 595 | seq_puts(seq, ",nouser_xattr"); |
| 596 | #endif |
| 597 | #ifdef CONFIG_EROFS_FS_POSIX_ACL |
| 598 | if (test_opt(sbi, POSIX_ACL)) |
| 599 | seq_puts(seq, ",acl"); |
| 600 | else |
| 601 | seq_puts(seq, ",noacl"); |
| 602 | #endif |
Chao Yu | 9c07b3b | 2018-07-26 20:21:54 +0800 | [diff] [blame] | 603 | if (test_opt(sbi, FAULT_INJECTION)) |
| 604 | seq_printf(seq, ",fault_injection=%u", |
Julian Merida | 447a362 | 2019-03-18 20:58:41 -0300 | [diff] [blame] | 605 | erofs_get_fault_rate(sbi)); |
Gao Xiang | 4279f3f | 2019-07-31 23:57:49 +0800 | [diff] [blame] | 606 | #ifdef CONFIG_EROFS_FS_ZIP |
| 607 | if (sbi->cache_strategy == EROFS_ZIP_CACHE_DISABLED) { |
| 608 | seq_puts(seq, ",cache_strategy=disabled"); |
| 609 | } else if (sbi->cache_strategy == EROFS_ZIP_CACHE_READAHEAD) { |
| 610 | seq_puts(seq, ",cache_strategy=readahead"); |
| 611 | } else if (sbi->cache_strategy == EROFS_ZIP_CACHE_READAROUND) { |
| 612 | seq_puts(seq, ",cache_strategy=readaround"); |
| 613 | } else { |
| 614 | seq_puts(seq, ",cache_strategy=(unknown)"); |
| 615 | DBG_BUGON(1); |
| 616 | } |
| 617 | #endif |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 618 | return 0; |
| 619 | } |
| 620 | |
| 621 | static int erofs_remount(struct super_block *sb, int *flags, char *data) |
| 622 | { |
Chengguang Xu | d41076e | 2018-09-19 22:53:46 +0800 | [diff] [blame] | 623 | struct erofs_sb_info *sbi = EROFS_SB(sb); |
| 624 | unsigned int org_mnt_opt = sbi->mount_opt; |
| 625 | unsigned int org_inject_rate = erofs_get_fault_rate(sbi); |
| 626 | int err; |
| 627 | |
Gao Xiang | 8b987bc | 2018-12-05 21:23:13 +0800 | [diff] [blame] | 628 | DBG_BUGON(!sb_rdonly(sb)); |
Chengguang Xu | d41076e | 2018-09-19 22:53:46 +0800 | [diff] [blame] | 629 | err = parse_options(sb, data); |
| 630 | if (err) |
| 631 | goto out; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 632 | |
Gao Xiang | 516c115c | 2019-01-29 16:35:20 +0800 | [diff] [blame] | 633 | if (test_opt(sbi, POSIX_ACL)) |
| 634 | sb->s_flags |= SB_POSIXACL; |
| 635 | else |
| 636 | sb->s_flags &= ~SB_POSIXACL; |
| 637 | |
Gao Xiang | 5f0abea | 2018-09-06 17:01:47 +0800 | [diff] [blame] | 638 | *flags |= SB_RDONLY; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 639 | return 0; |
Chengguang Xu | d41076e | 2018-09-19 22:53:46 +0800 | [diff] [blame] | 640 | out: |
| 641 | __erofs_build_fault_attr(sbi, org_inject_rate); |
| 642 | sbi->mount_opt = org_mnt_opt; |
| 643 | |
| 644 | return err; |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 645 | } |
| 646 | |
| 647 | const struct super_operations erofs_sops = { |
| 648 | .put_super = erofs_put_super, |
| 649 | .alloc_inode = alloc_inode, |
Al Viro | 25af6c4 | 2019-04-10 14:59:08 -0400 | [diff] [blame] | 650 | .free_inode = free_inode, |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 651 | .statfs = erofs_statfs, |
| 652 | .show_options = erofs_show_options, |
| 653 | .remount_fs = erofs_remount, |
| 654 | }; |
| 655 | |
| 656 | module_init(erofs_module_init); |
| 657 | module_exit(erofs_module_exit); |
| 658 | |
| 659 | MODULE_DESCRIPTION("Enhanced ROM File System"); |
Gao Xiang | bc33d9f | 2019-07-31 23:57:51 +0800 | [diff] [blame] | 660 | MODULE_AUTHOR("Gao Xiang, Chao Yu, Miao Xie, CONSUMER BG, HUAWEI Inc."); |
Gao Xiang | ba2b77a | 2018-07-26 20:21:46 +0800 | [diff] [blame] | 661 | MODULE_LICENSE("GPL"); |
| 662 | |