Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

squashfs: add xattr support configure option

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>

+63 -8
+11
fs/squashfs/Kconfig
··· 26 26 27 27 If unsure, say N. 28 28 29 + config SQUASHFS_XATTRS 30 + bool "Squashfs XATTR support" 31 + depends on SQUASHFS 32 + default n 33 + help 34 + Saying Y here includes support for extended attributes (xattrs). 35 + Xattrs are name:value pairs associated with inodes by 36 + the kernel or by users (see the attr(5) manual page). 37 + 38 + If unsure, say N. 39 + 29 40 config SQUASHFS_EMBEDDED 30 41 31 42 bool "Additional option for memory-constrained systems"
+1 -1
fs/squashfs/Makefile
··· 5 5 obj-$(CONFIG_SQUASHFS) += squashfs.o 6 6 squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o 7 7 squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o 8 - squashfs-y += xattr.o xattr_id.o 8 + squashfs-$(CONFIG_SQUASHFS_XATTRS) += xattr.o xattr_id.o 9 9
+1
fs/squashfs/inode.c
··· 46 46 #include "squashfs_fs_sb.h" 47 47 #include "squashfs_fs_i.h" 48 48 #include "squashfs.h" 49 + #include "xattr.h" 49 50 50 51 /* 51 52 * Initialise VFS inode with the base inode information common to all
+1
fs/squashfs/namei.c
··· 63 63 #include "squashfs_fs_sb.h" 64 64 #include "squashfs_fs_i.h" 65 65 #include "squashfs.h" 66 + #include "xattr.h" 66 67 67 68 /* 68 69 * Lookup name in the directory index, returning the location of the metadata
-6
fs/squashfs/squashfs.h
··· 76 76 /* xattr.c */ 77 77 extern ssize_t squashfs_listxattr(struct dentry *, char *, size_t); 78 78 79 - /* xattr_id.c */ 80 - extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *, 81 - int *, long long *); 82 - extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64, 83 - u64 *, int *); 84 - 85 79 /* 86 80 * Inodes, files, decompressor and xattr operations 87 81 */
+3 -1
fs/squashfs/super.c
··· 43 43 #include "squashfs_fs_i.h" 44 44 #include "squashfs.h" 45 45 #include "decompressor.h" 46 + #include "xattr.h" 46 47 47 48 static struct file_system_type squashfs_fs_type; 48 49 static const struct super_operations squashfs_super_ops; ··· 273 272 if (IS_ERR(msblk->xattr_id_table)) { 274 273 err = PTR_ERR(msblk->xattr_id_table); 275 274 msblk->xattr_id_table = NULL; 276 - goto failed_mount; 275 + if (err != -ENOTSUPP) 276 + goto failed_mount; 277 277 } 278 278 allocate_root: 279 279 root = new_inode(sb);
+1
fs/squashfs/symlink.c
··· 41 41 #include "squashfs_fs_sb.h" 42 42 #include "squashfs_fs_i.h" 43 43 #include "squashfs.h" 44 + #include "xattr.h" 44 45 45 46 static int squashfs_symlink_readpage(struct file *file, struct page *page) 46 47 {
+45
fs/squashfs/xattr.h
··· 1 + /* 2 + * Squashfs - a compressed read only filesystem for Linux 3 + * 4 + * Copyright (c) 2010 5 + * Phillip Lougher <phillip@lougher.demon.co.uk> 6 + * 7 + * This program is free software; you can redistribute it and/or 8 + * modify it under the terms of the GNU General Public License 9 + * as published by the Free Software Foundation; either version 2, 10 + * or (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 + * 21 + * xattr.h 22 + */ 23 + 24 + #ifdef CONFIG_SQUASHFS_XATTRS 25 + extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64, 26 + u64 *, int *); 27 + extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *, 28 + int *, long long *); 29 + #else 30 + static inline __le64 *squashfs_read_xattr_id_table(struct super_block *sb, 31 + u64 start, u64 *xattr_table_start, int *xattr_ids) 32 + { 33 + ERROR("Xattrs in filesystem, these will be ignored\n"); 34 + return ERR_PTR(-ENOTSUPP); 35 + } 36 + 37 + static inline int squashfs_xattr_lookup(struct super_block *sb, 38 + unsigned int index, int *count, int *size, long long *xattr) 39 + { 40 + return 0; 41 + } 42 + #define squashfs_listxattr NULL 43 + #define generic_getxattr NULL 44 + #define squashfs_xattr_handlers NULL 45 + #endif