diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2015-02-16 18:59:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-16 20:56:04 -0500 |
commit | 9c3ce9ec58716733232b97771b10f31901caf62e (patch) | |
tree | 25cc2bebbbc248d97f71262a542c7ee0e96411c0 /fs | |
parent | 97443aa809a142b1e6db2ccfb046c3a962907204 (diff) |
ext2: get rid of most mentions of XIP in ext2
To help people transition, accept the 'xip' mount option (and report it in
/proc/mounts), but print a message encouraging people to switch over to
the 'dax' option.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Boaz Harrosh <boaz@plexistor.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext2/ext2.h | 13 | ||||
-rw-r--r-- | fs/ext2/file.c | 2 | ||||
-rw-r--r-- | fs/ext2/inode.c | 6 | ||||
-rw-r--r-- | fs/ext2/namei.c | 8 | ||||
-rw-r--r-- | fs/ext2/super.c | 25 |
5 files changed, 31 insertions, 23 deletions
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index ab9b3ec3bac9..678f9ab08c48 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h | |||
@@ -380,14 +380,15 @@ struct ext2_inode { | |||
380 | #define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ | 380 | #define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ |
381 | #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ | 381 | #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ |
382 | #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ | 382 | #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ |
383 | #ifdef CONFIG_FS_DAX | 383 | #define EXT2_MOUNT_XIP 0x010000 /* Obsolete, use DAX */ |
384 | #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ | ||
385 | #else | ||
386 | #define EXT2_MOUNT_XIP 0 | ||
387 | #endif | ||
388 | #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ | 384 | #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ |
389 | #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ | 385 | #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ |
390 | #define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ | 386 | #define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ |
387 | #ifdef CONFIG_FS_DAX | ||
388 | #define EXT2_MOUNT_DAX 0x100000 /* Direct Access */ | ||
389 | #else | ||
390 | #define EXT2_MOUNT_DAX 0 | ||
391 | #endif | ||
391 | 392 | ||
392 | 393 | ||
393 | #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt | 394 | #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt |
@@ -792,7 +793,7 @@ extern int ext2_fsync(struct file *file, loff_t start, loff_t end, | |||
792 | int datasync); | 793 | int datasync); |
793 | extern const struct inode_operations ext2_file_inode_operations; | 794 | extern const struct inode_operations ext2_file_inode_operations; |
794 | extern const struct file_operations ext2_file_operations; | 795 | extern const struct file_operations ext2_file_operations; |
795 | extern const struct file_operations ext2_xip_file_operations; | 796 | extern const struct file_operations ext2_dax_file_operations; |
796 | 797 | ||
797 | /* inode.c */ | 798 | /* inode.c */ |
798 | extern const struct address_space_operations ext2_aops; | 799 | extern const struct address_space_operations ext2_aops; |
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index de8174d1e973..e31701713516 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
@@ -109,7 +109,7 @@ const struct file_operations ext2_file_operations = { | |||
109 | }; | 109 | }; |
110 | 110 | ||
111 | #ifdef CONFIG_FS_DAX | 111 | #ifdef CONFIG_FS_DAX |
112 | const struct file_operations ext2_xip_file_operations = { | 112 | const struct file_operations ext2_dax_file_operations = { |
113 | .llseek = generic_file_llseek, | 113 | .llseek = generic_file_llseek, |
114 | .read = new_sync_read, | 114 | .read = new_sync_read, |
115 | .write = new_sync_write, | 115 | .write = new_sync_write, |
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 034fd42eade0..6434bc000125 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -1286,7 +1286,7 @@ void ext2_set_inode_flags(struct inode *inode) | |||
1286 | inode->i_flags |= S_NOATIME; | 1286 | inode->i_flags |= S_NOATIME; |
1287 | if (flags & EXT2_DIRSYNC_FL) | 1287 | if (flags & EXT2_DIRSYNC_FL) |
1288 | inode->i_flags |= S_DIRSYNC; | 1288 | inode->i_flags |= S_DIRSYNC; |
1289 | if (test_opt(inode->i_sb, XIP)) | 1289 | if (test_opt(inode->i_sb, DAX)) |
1290 | inode->i_flags |= S_DAX; | 1290 | inode->i_flags |= S_DAX; |
1291 | } | 1291 | } |
1292 | 1292 | ||
@@ -1388,9 +1388,9 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) | |||
1388 | 1388 | ||
1389 | if (S_ISREG(inode->i_mode)) { | 1389 | if (S_ISREG(inode->i_mode)) { |
1390 | inode->i_op = &ext2_file_inode_operations; | 1390 | inode->i_op = &ext2_file_inode_operations; |
1391 | if (test_opt(inode->i_sb, XIP)) { | 1391 | if (test_opt(inode->i_sb, DAX)) { |
1392 | inode->i_mapping->a_ops = &ext2_aops; | 1392 | inode->i_mapping->a_ops = &ext2_aops; |
1393 | inode->i_fop = &ext2_xip_file_operations; | 1393 | inode->i_fop = &ext2_dax_file_operations; |
1394 | } else if (test_opt(inode->i_sb, NOBH)) { | 1394 | } else if (test_opt(inode->i_sb, NOBH)) { |
1395 | inode->i_mapping->a_ops = &ext2_nobh_aops; | 1395 | inode->i_mapping->a_ops = &ext2_nobh_aops; |
1396 | inode->i_fop = &ext2_file_operations; | 1396 | inode->i_fop = &ext2_file_operations; |
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 0db888c91bec..148f6e3789ea 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c | |||
@@ -104,9 +104,9 @@ static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode | |||
104 | return PTR_ERR(inode); | 104 | return PTR_ERR(inode); |
105 | 105 | ||
106 | inode->i_op = &ext2_file_inode_operations; | 106 | inode->i_op = &ext2_file_inode_operations; |
107 | if (test_opt(inode->i_sb, XIP)) { | 107 | if (test_opt(inode->i_sb, DAX)) { |
108 | inode->i_mapping->a_ops = &ext2_aops; | 108 | inode->i_mapping->a_ops = &ext2_aops; |
109 | inode->i_fop = &ext2_xip_file_operations; | 109 | inode->i_fop = &ext2_dax_file_operations; |
110 | } else if (test_opt(inode->i_sb, NOBH)) { | 110 | } else if (test_opt(inode->i_sb, NOBH)) { |
111 | inode->i_mapping->a_ops = &ext2_nobh_aops; | 111 | inode->i_mapping->a_ops = &ext2_nobh_aops; |
112 | inode->i_fop = &ext2_file_operations; | 112 | inode->i_fop = &ext2_file_operations; |
@@ -125,9 +125,9 @@ static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
125 | return PTR_ERR(inode); | 125 | return PTR_ERR(inode); |
126 | 126 | ||
127 | inode->i_op = &ext2_file_inode_operations; | 127 | inode->i_op = &ext2_file_inode_operations; |
128 | if (test_opt(inode->i_sb, XIP)) { | 128 | if (test_opt(inode->i_sb, DAX)) { |
129 | inode->i_mapping->a_ops = &ext2_aops; | 129 | inode->i_mapping->a_ops = &ext2_aops; |
130 | inode->i_fop = &ext2_xip_file_operations; | 130 | inode->i_fop = &ext2_dax_file_operations; |
131 | } else if (test_opt(inode->i_sb, NOBH)) { | 131 | } else if (test_opt(inode->i_sb, NOBH)) { |
132 | inode->i_mapping->a_ops = &ext2_nobh_aops; | 132 | inode->i_mapping->a_ops = &ext2_nobh_aops; |
133 | inode->i_fop = &ext2_file_operations; | 133 | inode->i_fop = &ext2_file_operations; |
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 5f029d8c3a02..d0e746e96511 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -294,6 +294,8 @@ static int ext2_show_options(struct seq_file *seq, struct dentry *root) | |||
294 | #ifdef CONFIG_FS_DAX | 294 | #ifdef CONFIG_FS_DAX |
295 | if (sbi->s_mount_opt & EXT2_MOUNT_XIP) | 295 | if (sbi->s_mount_opt & EXT2_MOUNT_XIP) |
296 | seq_puts(seq, ",xip"); | 296 | seq_puts(seq, ",xip"); |
297 | if (sbi->s_mount_opt & EXT2_MOUNT_DAX) | ||
298 | seq_puts(seq, ",dax"); | ||
297 | #endif | 299 | #endif |
298 | 300 | ||
299 | if (!test_opt(sb, RESERVATION)) | 301 | if (!test_opt(sb, RESERVATION)) |
@@ -402,7 +404,7 @@ enum { | |||
402 | Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, | 404 | Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, |
403 | Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug, | 405 | Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug, |
404 | Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr, | 406 | Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr, |
405 | Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota, | 407 | Opt_acl, Opt_noacl, Opt_xip, Opt_dax, Opt_ignore, Opt_err, Opt_quota, |
406 | Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation | 408 | Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation |
407 | }; | 409 | }; |
408 | 410 | ||
@@ -431,6 +433,7 @@ static const match_table_t tokens = { | |||
431 | {Opt_acl, "acl"}, | 433 | {Opt_acl, "acl"}, |
432 | {Opt_noacl, "noacl"}, | 434 | {Opt_noacl, "noacl"}, |
433 | {Opt_xip, "xip"}, | 435 | {Opt_xip, "xip"}, |
436 | {Opt_dax, "dax"}, | ||
434 | {Opt_grpquota, "grpquota"}, | 437 | {Opt_grpquota, "grpquota"}, |
435 | {Opt_ignore, "noquota"}, | 438 | {Opt_ignore, "noquota"}, |
436 | {Opt_quota, "quota"}, | 439 | {Opt_quota, "quota"}, |
@@ -558,10 +561,14 @@ static int parse_options(char *options, struct super_block *sb) | |||
558 | break; | 561 | break; |
559 | #endif | 562 | #endif |
560 | case Opt_xip: | 563 | case Opt_xip: |
564 | ext2_msg(sb, KERN_INFO, "use dax instead of xip"); | ||
565 | set_opt(sbi->s_mount_opt, XIP); | ||
566 | /* Fall through */ | ||
567 | case Opt_dax: | ||
561 | #ifdef CONFIG_FS_DAX | 568 | #ifdef CONFIG_FS_DAX |
562 | set_opt (sbi->s_mount_opt, XIP); | 569 | set_opt(sbi->s_mount_opt, DAX); |
563 | #else | 570 | #else |
564 | ext2_msg(sb, KERN_INFO, "xip option not supported"); | 571 | ext2_msg(sb, KERN_INFO, "dax option not supported"); |
565 | #endif | 572 | #endif |
566 | break; | 573 | break; |
567 | 574 | ||
@@ -905,15 +912,15 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
905 | 912 | ||
906 | blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); | 913 | blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); |
907 | 914 | ||
908 | if (sbi->s_mount_opt & EXT2_MOUNT_XIP) { | 915 | if (sbi->s_mount_opt & EXT2_MOUNT_DAX) { |
909 | if (blocksize != PAGE_SIZE) { | 916 | if (blocksize != PAGE_SIZE) { |
910 | ext2_msg(sb, KERN_ERR, | 917 | ext2_msg(sb, KERN_ERR, |
911 | "error: unsupported blocksize for xip"); | 918 | "error: unsupported blocksize for dax"); |
912 | goto failed_mount; | 919 | goto failed_mount; |
913 | } | 920 | } |
914 | if (!sb->s_bdev->bd_disk->fops->direct_access) { | 921 | if (!sb->s_bdev->bd_disk->fops->direct_access) { |
915 | ext2_msg(sb, KERN_ERR, | 922 | ext2_msg(sb, KERN_ERR, |
916 | "error: device does not support xip"); | 923 | "error: device does not support dax"); |
917 | goto failed_mount; | 924 | goto failed_mount; |
918 | } | 925 | } |
919 | } | 926 | } |
@@ -1286,10 +1293,10 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1286 | ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | 1293 | ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); |
1287 | 1294 | ||
1288 | es = sbi->s_es; | 1295 | es = sbi->s_es; |
1289 | if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_XIP) { | 1296 | if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_DAX) { |
1290 | ext2_msg(sb, KERN_WARNING, "warning: refusing change of " | 1297 | ext2_msg(sb, KERN_WARNING, "warning: refusing change of " |
1291 | "xip flag with busy inodes while remounting"); | 1298 | "dax flag with busy inodes while remounting"); |
1292 | sbi->s_mount_opt ^= EXT2_MOUNT_XIP; | 1299 | sbi->s_mount_opt ^= EXT2_MOUNT_DAX; |
1293 | } | 1300 | } |
1294 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { | 1301 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { |
1295 | spin_unlock(&sbi->s_lock); | 1302 | spin_unlock(&sbi->s_lock); |