summaryrefslogtreecommitdiffstats
path: root/lib/libspl
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-05-19 11:44:07 -0700
committerBrian Behlendorf <[email protected]>2011-07-01 13:36:39 -0700
commit2cf7f52bc42f215d4ef27d0fd75fc1b1417cb841 (patch)
tree3b30ae22546bd09968cff08c7a41bb9e791ea91d /lib/libspl
parent5c03efc379693f992ebe39c6a00c7297c4a304ea (diff)
Linux compat 2.6.39: mount_nodev()
The .get_sb callback has been replaced by a .mount callback in the file_system_type structure. When using the new interface the caller must now use the mount_nodev() helper. Unfortunately, the new interface no longer passes the vfsmount down to the zfs layers. This poses a problem for the existing implementation because we currently save this pointer in the super block for latter use. It provides our only entry point in to the namespace layer for manipulating certain mount options. This needed to be done originally to allow commands like 'zfs set atime=off tank' to work properly. It also allowed me to keep more of the original Solaris code unmodified. Under Solaris there is a 1-to-1 mapping between a mount point and a file system so this is a fairly natural thing to do. However, under Linux they many be multiple entries in the namespace which reference the same filesystem. Thus keeping a back reference from the filesystem to the namespace is complicated. Rather than introduce some ugly hack to get the vfsmount and continue as before. I'm leveraging this API change to update the ZFS code to do things in a more natural way for Linux. This has the upside that is resolves the compatibility issue for the long term and fixes several other minor bugs which have been reported. This commit updates the code to remove this vfsmount back reference entirely. All modifications to filesystem mount options are now passed in to the kernel via a '-o remount'. This is the expected Linux mechanism and allows the namespace to properly handle any options which apply to it before passing them on to the file system itself. Aside from fixing the compatibility issue, removing the vfsmount has had the benefit of simplifying the code. This change which fairly involved has turned out nicely. Closes #246 Closes #217 Closes #187 Closes #248 Closes #231
Diffstat (limited to 'lib/libspl')
-rw-r--r--lib/libspl/Makefile.in1
-rw-r--r--lib/libspl/asm-generic/Makefile.in1
-rw-r--r--lib/libspl/asm-i386/Makefile.in1
-rw-r--r--lib/libspl/asm-x86_64/Makefile.in1
-rw-r--r--lib/libspl/include/Makefile.in1
-rw-r--r--lib/libspl/include/ia32/Makefile.in1
-rw-r--r--lib/libspl/include/ia32/sys/Makefile.in1
-rw-r--r--lib/libspl/include/rpc/Makefile.in1
-rw-r--r--lib/libspl/include/sys/Makefile.in1
-rw-r--r--lib/libspl/include/sys/dktp/Makefile.in1
-rw-r--r--lib/libspl/include/sys/mntent.h4
-rw-r--r--lib/libspl/include/sys/sysevent/Makefile.in1
-rw-r--r--lib/libspl/include/util/Makefile.in1
13 files changed, 14 insertions, 2 deletions
diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in
index 09dd5245c..fa1ff51f1 100644
--- a/lib/libspl/Makefile.in
+++ b/lib/libspl/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in
index 7e03433f2..6aeb054b8 100644
--- a/lib/libspl/asm-generic/Makefile.in
+++ b/lib/libspl/asm-generic/Makefile.in
@@ -62,6 +62,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in
index 85bebc9b3..c91a2bb7f 100644
--- a/lib/libspl/asm-i386/Makefile.in
+++ b/lib/libspl/asm-i386/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in
index b6b9bed8f..7afeb56d8 100644
--- a/lib/libspl/asm-x86_64/Makefile.in
+++ b/lib/libspl/asm-x86_64/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in
index b2de0ad14..5708683ff 100644
--- a/lib/libspl/include/Makefile.in
+++ b/lib/libspl/include/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in
index d68fa7b74..7a6e4862e 100644
--- a/lib/libspl/include/ia32/Makefile.in
+++ b/lib/libspl/include/ia32/Makefile.in
@@ -61,6 +61,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in
index 30b81de33..2637df9cb 100644
--- a/lib/libspl/include/ia32/sys/Makefile.in
+++ b/lib/libspl/include/ia32/sys/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in
index 3b1270e58..9561e97a2 100644
--- a/lib/libspl/include/rpc/Makefile.in
+++ b/lib/libspl/include/rpc/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in
index ccfefaa5d..503fefb5a 100644
--- a/lib/libspl/include/sys/Makefile.in
+++ b/lib/libspl/include/sys/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in
index 9eed96c9d..40d4e0c44 100644
--- a/lib/libspl/include/sys/dktp/Makefile.in
+++ b/lib/libspl/include/sys/dktp/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/sys/mntent.h b/lib/libspl/include/sys/mntent.h
index 1cbdc3aeb..8fad65b56 100644
--- a/lib/libspl/include/sys/mntent.h
+++ b/lib/libspl/include/sys/mntent.h
@@ -88,8 +88,8 @@
#define MNTOPT_LOUD "loud" /* verbose mount */
#define MNTOPT_BIND "bind" /* remount part of a tree */
#define MNTOPT_RBIND "rbind" /* include subtrees */
-#define MNTOPT_XATTR "user_xattr" /* enable extended attributes */
-#define MNTOPT_NOXATTR "nouser_xattr" /* disable extended attributes */
+#define MNTOPT_XATTR "xattr" /* enable extended attributes */
+#define MNTOPT_NOXATTR "noxattr" /* disable extended attributes */
#define MNTOPT_COMMENT "comment" /* comment */
#define MNTOPT_ZFSUTIL "zfsutil" /* called by zfs utility */
diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in
index 83ce2b2fa..ed9f563cc 100644
--- a/lib/libspl/include/sys/sysevent/Makefile.in
+++ b/lib/libspl/include/sys/sysevent/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in
index 1339ebc48..2a2a0c16d 100644
--- a/lib/libspl/include/util/Makefile.in
+++ b/lib/libspl/include/util/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
+ $(top_srcdir)/config/kernel-mount-nodev.m4 \
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
$(top_srcdir)/config/kernel-rq-is_sync.m4 \