aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/squashfs/Kconfig11
-rw-r--r--fs/squashfs/Makefile2
-rw-r--r--fs/squashfs/inode.c1
-rw-r--r--fs/squashfs/namei.c1
-rw-r--r--fs/squashfs/squashfs.h6
-rw-r--r--fs/squashfs/super.c4
-rw-r--r--fs/squashfs/symlink.c1
-rw-r--r--fs/squashfs/xattr.h45
8 files changed, 63 insertions, 8 deletions
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig
index 25a00d19d686..cc6ce8a84c21 100644
--- a/fs/squashfs/Kconfig
+++ b/fs/squashfs/Kconfig
@@ -26,6 +26,17 @@ config SQUASHFS
26 26
27 If unsure, say N. 27 If unsure, say N.
28 28
29config 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
29config SQUASHFS_EMBEDDED 40config SQUASHFS_EMBEDDED
30 41
31 bool "Additional option for memory-constrained systems" 42 bool "Additional option for memory-constrained systems"
diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile
index 56684d464105..2cee3e9fa452 100644
--- a/fs/squashfs/Makefile
+++ b/fs/squashfs/Makefile
@@ -5,5 +5,5 @@
5obj-$(CONFIG_SQUASHFS) += squashfs.o 5obj-$(CONFIG_SQUASHFS) += squashfs.o
6squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o 6squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
7squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o 7squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
8squashfs-y += xattr.o xattr_id.o 8squashfs-$(CONFIG_SQUASHFS_XATTRS) += xattr.o xattr_id.o
9 9
diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c
index 250701180a3b..62e63ad25075 100644
--- a/fs/squashfs/inode.c
+++ b/fs/squashfs/inode.c
@@ -46,6 +46,7 @@
46#include "squashfs_fs_sb.h" 46#include "squashfs_fs_sb.h"
47#include "squashfs_fs_i.h" 47#include "squashfs_fs_i.h"
48#include "squashfs.h" 48#include "squashfs.h"
49#include "xattr.h"
49 50
50/* 51/*
51 * Initialise VFS inode with the base inode information common to all 52 * Initialise VFS inode with the base inode information common to all
diff --git a/fs/squashfs/namei.c b/fs/squashfs/namei.c
index 32f5b54d1cec..7a9464d08cf6 100644
--- a/fs/squashfs/namei.c
+++ b/fs/squashfs/namei.c
@@ -63,6 +63,7 @@
63#include "squashfs_fs_sb.h" 63#include "squashfs_fs_sb.h"
64#include "squashfs_fs_i.h" 64#include "squashfs_fs_i.h"
65#include "squashfs.h" 65#include "squashfs.h"
66#include "xattr.h"
66 67
67/* 68/*
68 * Lookup name in the directory index, returning the location of the metadata 69 * Lookup name in the directory index, returning the location of the metadata
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h
index 7d2381070581..305ce15d2d2d 100644
--- a/fs/squashfs/squashfs.h
+++ b/fs/squashfs/squashfs.h
@@ -76,12 +76,6 @@ extern int squashfs_read_inode(struct inode *, long long);
76/* xattr.c */ 76/* xattr.c */
77extern ssize_t squashfs_listxattr(struct dentry *, char *, size_t); 77extern ssize_t squashfs_listxattr(struct dentry *, char *, size_t);
78 78
79/* xattr_id.c */
80extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,
81 int *, long long *);
82extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64,
83 u64 *, int *);
84
85/* 79/*
86 * Inodes, files, decompressor and xattr operations 80 * Inodes, files, decompressor and xattr operations
87 */ 81 */
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index b6425ac1c2ae..88b4f8606652 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -43,6 +43,7 @@
43#include "squashfs_fs_i.h" 43#include "squashfs_fs_i.h"
44#include "squashfs.h" 44#include "squashfs.h"
45#include "decompressor.h" 45#include "decompressor.h"
46#include "xattr.h"
46 47
47static struct file_system_type squashfs_fs_type; 48static struct file_system_type squashfs_fs_type;
48static const struct super_operations squashfs_super_ops; 49static const struct super_operations squashfs_super_ops;
@@ -272,7 +273,8 @@ allocate_xattr_table:
272 if (IS_ERR(msblk->xattr_id_table)) { 273 if (IS_ERR(msblk->xattr_id_table)) {
273 err = PTR_ERR(msblk->xattr_id_table); 274 err = PTR_ERR(msblk->xattr_id_table);
274 msblk->xattr_id_table = NULL; 275 msblk->xattr_id_table = NULL;
275 goto failed_mount; 276 if (err != -ENOTSUPP)
277 goto failed_mount;
276 } 278 }
277allocate_root: 279allocate_root:
278 root = new_inode(sb); 280 root = new_inode(sb);
diff --git a/fs/squashfs/symlink.c b/fs/squashfs/symlink.c
index a7ee68a8621b..ec86434921e1 100644
--- a/fs/squashfs/symlink.c
+++ b/fs/squashfs/symlink.c
@@ -41,6 +41,7 @@
41#include "squashfs_fs_sb.h" 41#include "squashfs_fs_sb.h"
42#include "squashfs_fs_i.h" 42#include "squashfs_fs_i.h"
43#include "squashfs.h" 43#include "squashfs.h"
44#include "xattr.h"
44 45
45static int squashfs_symlink_readpage(struct file *file, struct page *page) 46static int squashfs_symlink_readpage(struct file *file, struct page *page)
46{ 47{
diff --git a/fs/squashfs/xattr.h b/fs/squashfs/xattr.h
new file mode 100644
index 000000000000..4a96366bfcc9
--- /dev/null
+++ b/fs/squashfs/xattr.h
@@ -0,0 +1,45 @@
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
25extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64,
26 u64 *, int *);
27extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,
28 int *, long long *);
29#else
30static 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
37static 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