Thomas Gleixner | 68252eb | 2019-05-20 19:08:00 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Squashfs - a compressed read only filesystem for Linux |
| 4 | * |
| 5 | * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
Phillip Lougher | d7f2ff6 | 2011-05-26 10:39:56 +0100 | [diff] [blame] | 6 | * Phillip Lougher <phillip@squashfs.org.uk> |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 7 | * |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 8 | * super.c |
| 9 | */ |
| 10 | |
| 11 | /* |
| 12 | * This file implements code to read the superblock, read and initialise |
| 13 | * in-memory structures at mount time, and all the VFS glue code to register |
| 14 | * the filesystem. |
| 15 | */ |
| 16 | |
Fabian Frederick | c811f5f | 2014-08-06 16:03:52 -0700 | [diff] [blame] | 17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 18 | |
Christoph Hellwig | be9a7b3 | 2021-10-18 12:11:23 +0200 | [diff] [blame] | 19 | #include <linux/blkdev.h> |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 20 | #include <linux/fs.h> |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 21 | #include <linux/fs_context.h> |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 22 | #include <linux/fs_parser.h> |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 23 | #include <linux/vfs.h> |
| 24 | #include <linux/slab.h> |
| 25 | #include <linux/mutex.h> |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 26 | #include <linux/seq_file.h> |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 27 | #include <linux/pagemap.h> |
| 28 | #include <linux/init.h> |
| 29 | #include <linux/module.h> |
Qinghuang Feng | 1bcbf31 | 2009-01-15 13:51:03 -0800 | [diff] [blame] | 30 | #include <linux/magic.h> |
Phillip Lougher | 4b5397d | 2010-05-14 20:48:47 +0100 | [diff] [blame] | 31 | #include <linux/xattr.h> |
Zheng Liang | 9eec1d8 | 2022-01-14 14:03:31 -0800 | [diff] [blame] | 32 | #include <linux/backing-dev.h> |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 33 | |
| 34 | #include "squashfs_fs.h" |
| 35 | #include "squashfs_fs_sb.h" |
| 36 | #include "squashfs_fs_i.h" |
| 37 | #include "squashfs.h" |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 38 | #include "decompressor.h" |
Phillip Lougher | 01e5b4e | 2010-05-17 19:39:02 +0100 | [diff] [blame] | 39 | #include "xattr.h" |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 40 | |
| 41 | static struct file_system_type squashfs_fs_type; |
Alexey Dobriyan | b87221d | 2009-09-21 17:01:09 -0700 | [diff] [blame] | 42 | static const struct super_operations squashfs_super_ops; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 43 | |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 44 | enum Opt_errors { |
| 45 | Opt_errors_continue, |
| 46 | Opt_errors_panic, |
| 47 | }; |
| 48 | |
| 49 | enum squashfs_param { |
| 50 | Opt_errors, |
| 51 | }; |
| 52 | |
| 53 | struct squashfs_mount_opts { |
| 54 | enum Opt_errors errors; |
| 55 | }; |
| 56 | |
| 57 | static const struct constant_table squashfs_param_errors[] = { |
| 58 | {"continue", Opt_errors_continue }, |
| 59 | {"panic", Opt_errors_panic }, |
| 60 | {} |
| 61 | }; |
| 62 | |
| 63 | static const struct fs_parameter_spec squashfs_fs_parameters[] = { |
| 64 | fsparam_enum("errors", Opt_errors, squashfs_param_errors), |
| 65 | {} |
| 66 | }; |
| 67 | |
| 68 | static int squashfs_parse_param(struct fs_context *fc, struct fs_parameter *param) |
| 69 | { |
| 70 | struct squashfs_mount_opts *opts = fc->fs_private; |
| 71 | struct fs_parse_result result; |
| 72 | int opt; |
| 73 | |
| 74 | opt = fs_parse(fc, squashfs_fs_parameters, param, &result); |
| 75 | if (opt < 0) |
| 76 | return opt; |
| 77 | |
| 78 | switch (opt) { |
| 79 | case Opt_errors: |
| 80 | opts->errors = result.uint_32; |
| 81 | break; |
| 82 | default: |
| 83 | return -EINVAL; |
| 84 | } |
| 85 | |
| 86 | return 0; |
| 87 | } |
| 88 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 89 | static const struct squashfs_decompressor *supported_squashfs_filesystem( |
| 90 | struct fs_context *fc, |
| 91 | short major, short minor, short id) |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 92 | { |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 93 | const struct squashfs_decompressor *decompressor; |
| 94 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 95 | if (major < SQUASHFS_MAJOR) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 96 | errorf(fc, "Major/Minor mismatch, older Squashfs %d.%d " |
| 97 | "filesystems are unsupported", major, minor); |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 98 | return NULL; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 99 | } else if (major > SQUASHFS_MAJOR || minor > SQUASHFS_MINOR) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 100 | errorf(fc, "Major/Minor mismatch, trying to mount newer " |
| 101 | "%d.%d filesystem", major, minor); |
| 102 | errorf(fc, "Please update your kernel"); |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 103 | return NULL; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 104 | } |
| 105 | |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 106 | decompressor = squashfs_lookup_decompressor(id); |
| 107 | if (!decompressor->supported) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 108 | errorf(fc, "Filesystem uses \"%s\" compression. This is not supported", |
| 109 | decompressor->name); |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 110 | return NULL; |
| 111 | } |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 112 | |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 113 | return decompressor; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Zheng Liang | 9eec1d8 | 2022-01-14 14:03:31 -0800 | [diff] [blame] | 116 | static int squashfs_bdi_init(struct super_block *sb) |
| 117 | { |
| 118 | int err; |
| 119 | unsigned int major = MAJOR(sb->s_dev); |
| 120 | unsigned int minor = MINOR(sb->s_dev); |
| 121 | |
| 122 | bdi_put(sb->s_bdi); |
| 123 | sb->s_bdi = &noop_backing_dev_info; |
| 124 | |
| 125 | err = super_setup_bdi_name(sb, "squashfs_%u_%u", major, minor); |
| 126 | if (err) |
| 127 | return err; |
| 128 | |
| 129 | sb->s_bdi->ra_pages = 0; |
| 130 | sb->s_bdi->io_pages = 0; |
| 131 | |
| 132 | return 0; |
| 133 | } |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 134 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 135 | static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 136 | { |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 137 | struct squashfs_mount_opts *opts = fc->fs_private; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 138 | struct squashfs_sb_info *msblk; |
| 139 | struct squashfs_super_block *sblk = NULL; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 140 | struct inode *root; |
| 141 | long long root_inode; |
| 142 | unsigned short flags; |
| 143 | unsigned int fragments; |
Phillip Lougher | 37986f6 | 2011-05-24 04:05:22 +0100 | [diff] [blame] | 144 | u64 lookup_table_start, xattr_id_table_start, next_table; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 145 | int err; |
| 146 | |
| 147 | TRACE("Entered squashfs_fill_superblock\n"); |
| 148 | |
Zheng Liang | 9eec1d8 | 2022-01-14 14:03:31 -0800 | [diff] [blame] | 149 | /* |
| 150 | * squashfs provides 'backing_dev_info' in order to disable read-ahead. For |
| 151 | * squashfs, I/O is not deferred, it is done immediately in readpage, |
| 152 | * which means the user would always have to wait their own I/O. So the effect |
| 153 | * of readahead is very weak for squashfs. squashfs_bdi_init will set |
| 154 | * sb->s_bdi->ra_pages and sb->s_bdi->io_pages to 0 and close readahead for |
| 155 | * squashfs. |
| 156 | */ |
| 157 | err = squashfs_bdi_init(sb); |
| 158 | if (err) { |
| 159 | errorf(fc, "squashfs init bdi failed"); |
| 160 | return err; |
| 161 | } |
| 162 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 163 | sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL); |
| 164 | if (sb->s_fs_info == NULL) { |
| 165 | ERROR("Failed to allocate squashfs_sb_info\n"); |
| 166 | return -ENOMEM; |
| 167 | } |
| 168 | msblk = sb->s_fs_info; |
| 169 | |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 170 | msblk->panic_on_errors = (opts->errors == Opt_errors_panic); |
| 171 | |
Phillip Lougher | 7657cac | 2011-10-22 01:34:48 +0100 | [diff] [blame] | 172 | msblk->devblksize = sb_min_blocksize(sb, SQUASHFS_DEVBLK_SIZE); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 173 | msblk->devblksize_log2 = ffz(~msblk->devblksize); |
| 174 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 175 | mutex_init(&msblk->meta_index_mutex); |
| 176 | |
| 177 | /* |
| 178 | * msblk->bytes_used is checked in squashfs_read_table to ensure reads |
| 179 | * are not beyond filesystem end. But as we're using |
| 180 | * squashfs_read_table here to read the superblock (including the value |
| 181 | * of bytes_used) we need to set it to an initial sensible dummy value |
| 182 | */ |
| 183 | msblk->bytes_used = sizeof(*sblk); |
Phillip Lougher | 82de647 | 2011-05-20 02:26:43 +0100 | [diff] [blame] | 184 | sblk = squashfs_read_table(sb, SQUASHFS_START, sizeof(*sblk)); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 185 | |
Phillip Lougher | 82de647 | 2011-05-20 02:26:43 +0100 | [diff] [blame] | 186 | if (IS_ERR(sblk)) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 187 | errorf(fc, "unable to read squashfs_super_block"); |
Phillip Lougher | 82de647 | 2011-05-20 02:26:43 +0100 | [diff] [blame] | 188 | err = PTR_ERR(sblk); |
| 189 | sblk = NULL; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 190 | goto failed_mount; |
| 191 | } |
| 192 | |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 193 | err = -EINVAL; |
| 194 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 195 | /* Check it is a SQUASHFS superblock */ |
| 196 | sb->s_magic = le32_to_cpu(sblk->s_magic); |
| 197 | if (sb->s_magic != SQUASHFS_MAGIC) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 198 | if (!(fc->sb_flags & SB_SILENT)) |
| 199 | errorf(fc, "Can't find a SQUASHFS superblock on %pg", |
| 200 | sb->s_bdev); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 201 | goto failed_mount; |
| 202 | } |
| 203 | |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 204 | /* Check the MAJOR & MINOR versions and lookup compression type */ |
| 205 | msblk->decompressor = supported_squashfs_filesystem( |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 206 | fc, |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 207 | le16_to_cpu(sblk->s_major), |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 208 | le16_to_cpu(sblk->s_minor), |
| 209 | le16_to_cpu(sblk->compression)); |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 210 | if (msblk->decompressor == NULL) |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 211 | goto failed_mount; |
| 212 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 213 | /* Check the filesystem does not extend beyond the end of the |
| 214 | block device */ |
| 215 | msblk->bytes_used = le64_to_cpu(sblk->bytes_used); |
Christoph Hellwig | be9a7b3 | 2021-10-18 12:11:23 +0200 | [diff] [blame] | 216 | if (msblk->bytes_used < 0 || |
| 217 | msblk->bytes_used > bdev_nr_bytes(sb->s_bdev)) |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 218 | goto failed_mount; |
| 219 | |
| 220 | /* Check block size for sanity */ |
| 221 | msblk->block_size = le32_to_cpu(sblk->block_size); |
| 222 | if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE) |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 223 | goto insanity; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 224 | |
Phillip Lougher | fffb47b | 2009-05-13 02:59:26 +0100 | [diff] [blame] | 225 | /* |
| 226 | * Check the system page size is not larger than the filesystem |
| 227 | * block size (by default 128K). This is currently not supported. |
| 228 | */ |
Kirill A. Shutemov | 09cbfea | 2016-04-01 15:29:47 +0300 | [diff] [blame] | 229 | if (PAGE_SIZE > msblk->block_size) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 230 | errorf(fc, "Page size > filesystem block size (%d). This is " |
| 231 | "currently not supported!", msblk->block_size); |
Phillip Lougher | fffb47b | 2009-05-13 02:59:26 +0100 | [diff] [blame] | 232 | goto failed_mount; |
| 233 | } |
| 234 | |
Phillip Lougher | 4b0180a | 2012-03-09 03:02:59 +0000 | [diff] [blame] | 235 | /* Check block log for sanity */ |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 236 | msblk->block_log = le16_to_cpu(sblk->block_log); |
| 237 | if (msblk->block_log > SQUASHFS_FILE_MAX_LOG) |
| 238 | goto failed_mount; |
| 239 | |
Phillip Lougher | 4b0180a | 2012-03-09 03:02:59 +0000 | [diff] [blame] | 240 | /* Check that block_size and block_log match */ |
| 241 | if (msblk->block_size != (1 << msblk->block_log)) |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 242 | goto insanity; |
Phillip Lougher | 4b0180a | 2012-03-09 03:02:59 +0000 | [diff] [blame] | 243 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 244 | /* Check the root inode for sanity */ |
| 245 | root_inode = le64_to_cpu(sblk->root_inode); |
| 246 | if (SQUASHFS_INODE_OFFSET(root_inode) > SQUASHFS_METADATA_SIZE) |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 247 | goto insanity; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 248 | |
| 249 | msblk->inode_table = le64_to_cpu(sblk->inode_table_start); |
| 250 | msblk->directory_table = le64_to_cpu(sblk->directory_table_start); |
| 251 | msblk->inodes = le32_to_cpu(sblk->inodes); |
Linus Torvalds | 71755ee | 2018-08-02 08:43:35 -0700 | [diff] [blame] | 252 | msblk->fragments = le32_to_cpu(sblk->fragments); |
Phillip Lougher | f37aa4c | 2021-02-09 13:41:53 -0800 | [diff] [blame] | 253 | msblk->ids = le16_to_cpu(sblk->no_ids); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 254 | flags = le16_to_cpu(sblk->flags); |
| 255 | |
Dmitry Monakhov | a1c6f057 | 2015-04-13 16:31:37 +0400 | [diff] [blame] | 256 | TRACE("Found valid superblock on %pg\n", sb->s_bdev); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 257 | TRACE("Inodes are %scompressed\n", SQUASHFS_UNCOMPRESSED_INODES(flags) |
| 258 | ? "un" : ""); |
| 259 | TRACE("Data is %scompressed\n", SQUASHFS_UNCOMPRESSED_DATA(flags) |
| 260 | ? "un" : ""); |
| 261 | TRACE("Filesystem size %lld bytes\n", msblk->bytes_used); |
| 262 | TRACE("Block size %d\n", msblk->block_size); |
| 263 | TRACE("Number of inodes %d\n", msblk->inodes); |
Linus Torvalds | 71755ee | 2018-08-02 08:43:35 -0700 | [diff] [blame] | 264 | TRACE("Number of fragments %d\n", msblk->fragments); |
Phillip Lougher | f37aa4c | 2021-02-09 13:41:53 -0800 | [diff] [blame] | 265 | TRACE("Number of ids %d\n", msblk->ids); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 266 | TRACE("sblk->inode_table_start %llx\n", msblk->inode_table); |
| 267 | TRACE("sblk->directory_table_start %llx\n", msblk->directory_table); |
| 268 | TRACE("sblk->fragment_table_start %llx\n", |
| 269 | (u64) le64_to_cpu(sblk->fragment_table_start)); |
| 270 | TRACE("sblk->id_table_start %llx\n", |
| 271 | (u64) le64_to_cpu(sblk->id_table_start)); |
| 272 | |
| 273 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
Deepa Dinamani | 22b1396 | 2019-07-30 08:22:29 -0700 | [diff] [blame] | 274 | sb->s_time_min = 0; |
| 275 | sb->s_time_max = U32_MAX; |
Linus Torvalds | 1751e8a | 2017-11-27 13:05:09 -0800 | [diff] [blame] | 276 | sb->s_flags |= SB_RDONLY; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 277 | sb->s_op = &squashfs_super_ops; |
| 278 | |
| 279 | err = -ENOMEM; |
| 280 | |
| 281 | msblk->block_cache = squashfs_cache_init("metadata", |
| 282 | SQUASHFS_CACHED_BLKS, SQUASHFS_METADATA_SIZE); |
| 283 | if (msblk->block_cache == NULL) |
| 284 | goto failed_mount; |
| 285 | |
| 286 | /* Allocate read_page block */ |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame] | 287 | msblk->read_page = squashfs_cache_init("data", |
| 288 | squashfs_max_decompressors(), msblk->block_size); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 289 | if (msblk->read_page == NULL) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 290 | errorf(fc, "Failed to allocate read_page block"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 291 | goto failed_mount; |
| 292 | } |
| 293 | |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame] | 294 | msblk->stream = squashfs_decompressor_setup(sb, flags); |
Phillip Lougher | b7fc0ff | 2011-02-28 01:45:42 +0000 | [diff] [blame] | 295 | if (IS_ERR(msblk->stream)) { |
| 296 | err = PTR_ERR(msblk->stream); |
| 297 | msblk->stream = NULL; |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 298 | goto insanity; |
Phillip Lougher | b7fc0ff | 2011-02-28 01:45:42 +0000 | [diff] [blame] | 299 | } |
| 300 | |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 301 | /* Handle xattrs */ |
| 302 | sb->s_xattr = squashfs_xattr_handlers; |
| 303 | xattr_id_table_start = le64_to_cpu(sblk->xattr_id_table_start); |
Phillip Lougher | 37986f6 | 2011-05-24 04:05:22 +0100 | [diff] [blame] | 304 | if (xattr_id_table_start == SQUASHFS_INVALID_BLK) { |
| 305 | next_table = msblk->bytes_used; |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 306 | goto allocate_id_index_table; |
Phillip Lougher | 37986f6 | 2011-05-24 04:05:22 +0100 | [diff] [blame] | 307 | } |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 308 | |
| 309 | /* Allocate and read xattr id lookup table */ |
| 310 | msblk->xattr_id_table = squashfs_read_xattr_id_table(sb, |
| 311 | xattr_id_table_start, &msblk->xattr_table, &msblk->xattr_ids); |
| 312 | if (IS_ERR(msblk->xattr_id_table)) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 313 | errorf(fc, "unable to read xattr id index table"); |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 314 | err = PTR_ERR(msblk->xattr_id_table); |
| 315 | msblk->xattr_id_table = NULL; |
| 316 | if (err != -ENOTSUPP) |
| 317 | goto failed_mount; |
| 318 | } |
Phillip Lougher | 37986f6 | 2011-05-24 04:05:22 +0100 | [diff] [blame] | 319 | next_table = msblk->xattr_table; |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 320 | |
| 321 | allocate_id_index_table: |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 322 | /* Allocate and read id index table */ |
| 323 | msblk->id_table = squashfs_read_id_index_table(sb, |
Phillip Lougher | f37aa4c | 2021-02-09 13:41:53 -0800 | [diff] [blame] | 324 | le64_to_cpu(sblk->id_table_start), next_table, msblk->ids); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 325 | if (IS_ERR(msblk->id_table)) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 326 | errorf(fc, "unable to read id index table"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 327 | err = PTR_ERR(msblk->id_table); |
| 328 | msblk->id_table = NULL; |
| 329 | goto failed_mount; |
| 330 | } |
Phillip Lougher | d5b72ce | 2011-05-29 00:38:46 +0100 | [diff] [blame] | 331 | next_table = le64_to_cpu(msblk->id_table[0]); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 332 | |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 333 | /* Handle inode lookup table */ |
| 334 | lookup_table_start = le64_to_cpu(sblk->lookup_table_start); |
| 335 | if (lookup_table_start == SQUASHFS_INVALID_BLK) |
| 336 | goto handle_fragments; |
| 337 | |
| 338 | /* Allocate and read inode lookup table */ |
| 339 | msblk->inode_lookup_table = squashfs_read_inode_lookup_table(sb, |
Phillip Lougher | ac51a0a | 2011-05-24 04:15:21 +0100 | [diff] [blame] | 340 | lookup_table_start, next_table, msblk->inodes); |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 341 | if (IS_ERR(msblk->inode_lookup_table)) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 342 | errorf(fc, "unable to read inode lookup table"); |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 343 | err = PTR_ERR(msblk->inode_lookup_table); |
| 344 | msblk->inode_lookup_table = NULL; |
| 345 | goto failed_mount; |
| 346 | } |
Phillip Lougher | d5b72ce | 2011-05-29 00:38:46 +0100 | [diff] [blame] | 347 | next_table = le64_to_cpu(msblk->inode_lookup_table[0]); |
Phillip Lougher | 76e002f | 2011-05-24 02:57:05 +0100 | [diff] [blame] | 348 | |
| 349 | sb->s_export_op = &squashfs_export_ops; |
| 350 | |
| 351 | handle_fragments: |
Linus Torvalds | 71755ee | 2018-08-02 08:43:35 -0700 | [diff] [blame] | 352 | fragments = msblk->fragments; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 353 | if (fragments == 0) |
Phillip Lougher | 1094a4a | 2011-05-24 04:45:33 +0100 | [diff] [blame] | 354 | goto check_directory_table; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 355 | |
| 356 | msblk->fragment_cache = squashfs_cache_init("fragment", |
| 357 | SQUASHFS_CACHED_FRAGMENTS, msblk->block_size); |
| 358 | if (msblk->fragment_cache == NULL) { |
| 359 | err = -ENOMEM; |
| 360 | goto failed_mount; |
| 361 | } |
| 362 | |
| 363 | /* Allocate and read fragment index table */ |
| 364 | msblk->fragment_index = squashfs_read_fragment_index_table(sb, |
Phillip Lougher | 1cac63c | 2011-05-24 04:33:34 +0100 | [diff] [blame] | 365 | le64_to_cpu(sblk->fragment_table_start), next_table, fragments); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 366 | if (IS_ERR(msblk->fragment_index)) { |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 367 | errorf(fc, "unable to read fragment index table"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 368 | err = PTR_ERR(msblk->fragment_index); |
| 369 | msblk->fragment_index = NULL; |
| 370 | goto failed_mount; |
| 371 | } |
Phillip Lougher | d5b72ce | 2011-05-29 00:38:46 +0100 | [diff] [blame] | 372 | next_table = le64_to_cpu(msblk->fragment_index[0]); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 373 | |
Phillip Lougher | 1094a4a | 2011-05-24 04:45:33 +0100 | [diff] [blame] | 374 | check_directory_table: |
| 375 | /* Sanity check directory_table */ |
Phillip Lougher | cc37f75 | 2012-01-02 17:47:14 +0000 | [diff] [blame] | 376 | if (msblk->directory_table > next_table) { |
Phillip Lougher | 1094a4a | 2011-05-24 04:45:33 +0100 | [diff] [blame] | 377 | err = -EINVAL; |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 378 | goto insanity; |
Phillip Lougher | 1094a4a | 2011-05-24 04:45:33 +0100 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | /* Sanity check inode_table */ |
| 382 | if (msblk->inode_table >= msblk->directory_table) { |
| 383 | err = -EINVAL; |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 384 | goto insanity; |
Phillip Lougher | 1094a4a | 2011-05-24 04:45:33 +0100 | [diff] [blame] | 385 | } |
| 386 | |
| 387 | /* allocate root */ |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 388 | root = new_inode(sb); |
| 389 | if (!root) { |
| 390 | err = -ENOMEM; |
| 391 | goto failed_mount; |
| 392 | } |
| 393 | |
| 394 | err = squashfs_read_inode(root, root_inode); |
| 395 | if (err) { |
Phillip Lougher | 1cb08e9 | 2010-04-16 01:01:36 +0100 | [diff] [blame] | 396 | make_bad_inode(root); |
| 397 | iput(root); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 398 | goto failed_mount; |
| 399 | } |
| 400 | insert_inode_hash(root); |
| 401 | |
Al Viro | 48fde70 | 2012-01-08 22:15:13 -0500 | [diff] [blame] | 402 | sb->s_root = d_make_root(root); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 403 | if (sb->s_root == NULL) { |
| 404 | ERROR("Root inode create failed\n"); |
| 405 | err = -ENOMEM; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 406 | goto failed_mount; |
| 407 | } |
| 408 | |
| 409 | TRACE("Leaving squashfs_fill_super\n"); |
| 410 | kfree(sblk); |
| 411 | return 0; |
| 412 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 413 | insanity: |
| 414 | errorf(fc, "squashfs image failed sanity check"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 415 | failed_mount: |
| 416 | squashfs_cache_delete(msblk->block_cache); |
| 417 | squashfs_cache_delete(msblk->fragment_cache); |
| 418 | squashfs_cache_delete(msblk->read_page); |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame] | 419 | squashfs_decompressor_destroy(msblk); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 420 | kfree(msblk->inode_lookup_table); |
| 421 | kfree(msblk->fragment_index); |
| 422 | kfree(msblk->id_table); |
Phillip Lougher | 4b5397d | 2010-05-14 20:48:47 +0100 | [diff] [blame] | 423 | kfree(msblk->xattr_id_table); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 424 | kfree(sb->s_fs_info); |
| 425 | sb->s_fs_info = NULL; |
| 426 | kfree(sblk); |
| 427 | return err; |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 428 | } |
| 429 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 430 | static int squashfs_get_tree(struct fs_context *fc) |
| 431 | { |
| 432 | return get_tree_bdev(fc, squashfs_fill_super); |
| 433 | } |
| 434 | |
| 435 | static int squashfs_reconfigure(struct fs_context *fc) |
| 436 | { |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 437 | struct super_block *sb = fc->root->d_sb; |
| 438 | struct squashfs_sb_info *msblk = sb->s_fs_info; |
| 439 | struct squashfs_mount_opts *opts = fc->fs_private; |
| 440 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 441 | sync_filesystem(fc->root->d_sb); |
| 442 | fc->sb_flags |= SB_RDONLY; |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 443 | |
| 444 | msblk->panic_on_errors = (opts->errors == Opt_errors_panic); |
| 445 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 446 | return 0; |
| 447 | } |
| 448 | |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 449 | static void squashfs_free_fs_context(struct fs_context *fc) |
| 450 | { |
| 451 | kfree(fc->fs_private); |
| 452 | } |
| 453 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 454 | static const struct fs_context_operations squashfs_context_ops = { |
| 455 | .get_tree = squashfs_get_tree, |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 456 | .free = squashfs_free_fs_context, |
| 457 | .parse_param = squashfs_parse_param, |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 458 | .reconfigure = squashfs_reconfigure, |
| 459 | }; |
| 460 | |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 461 | static int squashfs_show_options(struct seq_file *s, struct dentry *root) |
| 462 | { |
| 463 | struct super_block *sb = root->d_sb; |
| 464 | struct squashfs_sb_info *msblk = sb->s_fs_info; |
| 465 | |
| 466 | if (msblk->panic_on_errors) |
| 467 | seq_puts(s, ",errors=panic"); |
| 468 | else |
| 469 | seq_puts(s, ",errors=continue"); |
| 470 | |
| 471 | return 0; |
| 472 | } |
| 473 | |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 474 | static int squashfs_init_fs_context(struct fs_context *fc) |
| 475 | { |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 476 | struct squashfs_mount_opts *opts; |
| 477 | |
| 478 | opts = kzalloc(sizeof(*opts), GFP_KERNEL); |
| 479 | if (!opts) |
| 480 | return -ENOMEM; |
| 481 | |
| 482 | fc->fs_private = opts; |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 483 | fc->ops = &squashfs_context_ops; |
| 484 | return 0; |
| 485 | } |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 486 | |
| 487 | static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
| 488 | { |
| 489 | struct squashfs_sb_info *msblk = dentry->d_sb->s_fs_info; |
Coly Li | 2fc7f56 | 2009-04-02 16:59:42 -0700 | [diff] [blame] | 490 | u64 id = huge_encode_dev(dentry->d_sb->s_bdev->bd_dev); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 491 | |
| 492 | TRACE("Entered squashfs_statfs\n"); |
| 493 | |
| 494 | buf->f_type = SQUASHFS_MAGIC; |
| 495 | buf->f_bsize = msblk->block_size; |
| 496 | buf->f_blocks = ((msblk->bytes_used - 1) >> msblk->block_log) + 1; |
| 497 | buf->f_bfree = buf->f_bavail = 0; |
| 498 | buf->f_files = msblk->inodes; |
| 499 | buf->f_ffree = 0; |
| 500 | buf->f_namelen = SQUASHFS_NAME_LEN; |
Al Viro | 6d1349c | 2020-09-18 16:45:50 -0400 | [diff] [blame] | 501 | buf->f_fsid = u64_to_fsid(id); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 502 | |
| 503 | return 0; |
| 504 | } |
| 505 | |
| 506 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 507 | static void squashfs_put_super(struct super_block *sb) |
| 508 | { |
| 509 | if (sb->s_fs_info) { |
| 510 | struct squashfs_sb_info *sbi = sb->s_fs_info; |
| 511 | squashfs_cache_delete(sbi->block_cache); |
| 512 | squashfs_cache_delete(sbi->fragment_cache); |
| 513 | squashfs_cache_delete(sbi->read_page); |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame] | 514 | squashfs_decompressor_destroy(sbi); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 515 | kfree(sbi->id_table); |
| 516 | kfree(sbi->fragment_index); |
| 517 | kfree(sbi->meta_index); |
Phillip Lougher | 370ec3d | 2010-04-23 00:24:22 +0100 | [diff] [blame] | 518 | kfree(sbi->inode_lookup_table); |
Phillip Lougher | 4b5397d | 2010-05-14 20:48:47 +0100 | [diff] [blame] | 519 | kfree(sbi->xattr_id_table); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 520 | kfree(sb->s_fs_info); |
| 521 | sb->s_fs_info = NULL; |
| 522 | } |
| 523 | } |
| 524 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 525 | static struct kmem_cache *squashfs_inode_cachep; |
| 526 | |
| 527 | |
| 528 | static void init_once(void *foo) |
| 529 | { |
| 530 | struct squashfs_inode_info *ei = foo; |
| 531 | |
| 532 | inode_init_once(&ei->vfs_inode); |
| 533 | } |
| 534 | |
| 535 | |
| 536 | static int __init init_inodecache(void) |
| 537 | { |
| 538 | squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache", |
| 539 | sizeof(struct squashfs_inode_info), 0, |
Vladimir Davydov | 5d09705 | 2016-01-14 15:18:21 -0800 | [diff] [blame] | 540 | SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT, |
| 541 | init_once); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 542 | |
| 543 | return squashfs_inode_cachep ? 0 : -ENOMEM; |
| 544 | } |
| 545 | |
| 546 | |
| 547 | static void destroy_inodecache(void) |
| 548 | { |
Kirill A. Shutemov | 8c0a853 | 2012-09-26 11:33:07 +1000 | [diff] [blame] | 549 | /* |
| 550 | * Make sure all delayed rcu free inodes are flushed before we |
| 551 | * destroy cache. |
| 552 | */ |
| 553 | rcu_barrier(); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 554 | kmem_cache_destroy(squashfs_inode_cachep); |
| 555 | } |
| 556 | |
| 557 | |
| 558 | static int __init init_squashfs_fs(void) |
| 559 | { |
| 560 | int err = init_inodecache(); |
| 561 | |
| 562 | if (err) |
| 563 | return err; |
| 564 | |
| 565 | err = register_filesystem(&squashfs_fs_type); |
| 566 | if (err) { |
| 567 | destroy_inodecache(); |
| 568 | return err; |
| 569 | } |
| 570 | |
Fabian Frederick | c811f5f | 2014-08-06 16:03:52 -0700 | [diff] [blame] | 571 | pr_info("version 4.0 (2009/01/31) Phillip Lougher\n"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 572 | |
| 573 | return 0; |
| 574 | } |
| 575 | |
| 576 | |
| 577 | static void __exit exit_squashfs_fs(void) |
| 578 | { |
| 579 | unregister_filesystem(&squashfs_fs_type); |
| 580 | destroy_inodecache(); |
| 581 | } |
| 582 | |
| 583 | |
| 584 | static struct inode *squashfs_alloc_inode(struct super_block *sb) |
| 585 | { |
| 586 | struct squashfs_inode_info *ei = |
| 587 | kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL); |
| 588 | |
| 589 | return ei ? &ei->vfs_inode : NULL; |
| 590 | } |
| 591 | |
| 592 | |
Al Viro | 56b5af1 | 2019-04-15 22:22:40 -0400 | [diff] [blame] | 593 | static void squashfs_free_inode(struct inode *inode) |
Nick Piggin | fa0d7e3d | 2011-01-07 17:49:49 +1100 | [diff] [blame] | 594 | { |
Nick Piggin | fa0d7e3d | 2011-01-07 17:49:49 +1100 | [diff] [blame] | 595 | kmem_cache_free(squashfs_inode_cachep, squashfs_i(inode)); |
| 596 | } |
| 597 | |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 598 | static struct file_system_type squashfs_fs_type = { |
| 599 | .owner = THIS_MODULE, |
| 600 | .name = "squashfs", |
David Howells | 5a2be12 | 2019-03-25 16:38:32 +0000 | [diff] [blame] | 601 | .init_fs_context = squashfs_init_fs_context, |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 602 | .parameters = squashfs_fs_parameters, |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 603 | .kill_sb = kill_block_super, |
| 604 | .fs_flags = FS_REQUIRES_DEV |
| 605 | }; |
Eric W. Biederman | 3e64fe5 | 2013-03-11 07:05:42 -0700 | [diff] [blame] | 606 | MODULE_ALIAS_FS("squashfs"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 607 | |
Alexey Dobriyan | b87221d | 2009-09-21 17:01:09 -0700 | [diff] [blame] | 608 | static const struct super_operations squashfs_super_ops = { |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 609 | .alloc_inode = squashfs_alloc_inode, |
Al Viro | 56b5af1 | 2019-04-15 22:22:40 -0400 | [diff] [blame] | 610 | .free_inode = squashfs_free_inode, |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 611 | .statfs = squashfs_statfs, |
| 612 | .put_super = squashfs_put_super, |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 613 | .show_options = squashfs_show_options, |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 614 | }; |
| 615 | |
| 616 | module_init(init_squashfs_fs); |
| 617 | module_exit(exit_squashfs_fs); |
| 618 | MODULE_DESCRIPTION("squashfs 4.0, a compressed read-only filesystem"); |
Phillip Lougher | d7f2ff6 | 2011-05-26 10:39:56 +0100 | [diff] [blame] | 619 | MODULE_AUTHOR("Phillip Lougher <phillip@squashfs.org.uk>"); |
Phillip Lougher | 0aa6661 | 2009-01-05 08:46:25 +0000 | [diff] [blame] | 620 | MODULE_LICENSE("GPL"); |