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

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>

authored by

Matthew Wilcox and committed by
Linus Torvalds
9c3ce9ec 97443aa8

+34 -25
+3 -2
Documentation/filesystems/ext2.txt
··· 20 20 check=none, nocheck (*) Don't do extra checking of bitmaps on mount 21 21 (check=normal and check=strict options removed) 22 22 23 + dax Use direct access (no page cache). See 24 + Documentation/filesystems/dax.txt. 25 + 23 26 debug Extra debugging information is sent to the 24 27 kernel syslog. Useful for developers. 25 28 ··· 58 55 noacl Don't support POSIX ACLs. 59 56 60 57 nobh Do not attach buffer_heads to file pagecache. 61 - 62 - xip Use execute in place (no caching) if possible 63 58 64 59 grpquota,noquota,quota,usrquota Quota options are silently ignored by ext2. 65 60
+7 -6
fs/ext2/ext2.h
··· 380 380 #define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ 381 381 #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ 382 382 #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ 383 - #ifdef CONFIG_FS_DAX 384 - #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ 385 - #else 386 - #define EXT2_MOUNT_XIP 0 387 - #endif 383 + #define EXT2_MOUNT_XIP 0x010000 /* Obsolete, use DAX */ 388 384 #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ 389 385 #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ 390 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 394 #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt ··· 793 792 int datasync); 794 793 extern const struct inode_operations ext2_file_inode_operations; 795 794 extern const struct file_operations ext2_file_operations; 796 - extern const struct file_operations ext2_xip_file_operations; 795 + extern const struct file_operations ext2_dax_file_operations; 797 796 798 797 /* inode.c */ 799 798 extern const struct address_space_operations ext2_aops;
+1 -1
fs/ext2/file.c
··· 109 109 }; 110 110 111 111 #ifdef CONFIG_FS_DAX 112 - const struct file_operations ext2_xip_file_operations = { 112 + const struct file_operations ext2_dax_file_operations = { 113 113 .llseek = generic_file_llseek, 114 114 .read = new_sync_read, 115 115 .write = new_sync_write,
+3 -3
fs/ext2/inode.c
··· 1286 1286 inode->i_flags |= S_NOATIME; 1287 1287 if (flags & EXT2_DIRSYNC_FL) 1288 1288 inode->i_flags |= S_DIRSYNC; 1289 - if (test_opt(inode->i_sb, XIP)) 1289 + if (test_opt(inode->i_sb, DAX)) 1290 1290 inode->i_flags |= S_DAX; 1291 1291 } 1292 1292 ··· 1388 1388 1389 1389 if (S_ISREG(inode->i_mode)) { 1390 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 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 1394 } else if (test_opt(inode->i_sb, NOBH)) { 1395 1395 inode->i_mapping->a_ops = &ext2_nobh_aops; 1396 1396 inode->i_fop = &ext2_file_operations;
+4 -4
fs/ext2/namei.c
··· 104 104 return PTR_ERR(inode); 105 105 106 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 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 110 } else if (test_opt(inode->i_sb, NOBH)) { 111 111 inode->i_mapping->a_ops = &ext2_nobh_aops; 112 112 inode->i_fop = &ext2_file_operations; ··· 125 125 return PTR_ERR(inode); 126 126 127 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 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 131 } else if (test_opt(inode->i_sb, NOBH)) { 132 132 inode->i_mapping->a_ops = &ext2_nobh_aops; 133 133 inode->i_fop = &ext2_file_operations;
+16 -9
fs/ext2/super.c
··· 294 294 #ifdef CONFIG_FS_DAX 295 295 if (sbi->s_mount_opt & EXT2_MOUNT_XIP) 296 296 seq_puts(seq, ",xip"); 297 + if (sbi->s_mount_opt & EXT2_MOUNT_DAX) 298 + seq_puts(seq, ",dax"); 297 299 #endif 298 300 299 301 if (!test_opt(sb, RESERVATION)) ··· 404 402 Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, 405 403 Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug, 406 404 Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr, 407 - Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota, 405 + Opt_acl, Opt_noacl, Opt_xip, Opt_dax, Opt_ignore, Opt_err, Opt_quota, 408 406 Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation 409 407 }; 410 408 ··· 433 431 {Opt_acl, "acl"}, 434 432 {Opt_noacl, "noacl"}, 435 433 {Opt_xip, "xip"}, 434 + {Opt_dax, "dax"}, 436 435 {Opt_grpquota, "grpquota"}, 437 436 {Opt_ignore, "noquota"}, 438 437 {Opt_quota, "quota"}, ··· 561 558 break; 562 559 #endif 563 560 case Opt_xip: 561 + ext2_msg(sb, KERN_INFO, "use dax instead of xip"); 562 + set_opt(sbi->s_mount_opt, XIP); 563 + /* Fall through */ 564 + case Opt_dax: 564 565 #ifdef CONFIG_FS_DAX 565 - set_opt (sbi->s_mount_opt, XIP); 566 + set_opt(sbi->s_mount_opt, DAX); 566 567 #else 567 - ext2_msg(sb, KERN_INFO, "xip option not supported"); 568 + ext2_msg(sb, KERN_INFO, "dax option not supported"); 568 569 #endif 569 570 break; 570 571 ··· 912 905 913 906 blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); 914 907 915 - if (sbi->s_mount_opt & EXT2_MOUNT_XIP) { 908 + if (sbi->s_mount_opt & EXT2_MOUNT_DAX) { 916 909 if (blocksize != PAGE_SIZE) { 917 910 ext2_msg(sb, KERN_ERR, 918 - "error: unsupported blocksize for xip"); 911 + "error: unsupported blocksize for dax"); 919 912 goto failed_mount; 920 913 } 921 914 if (!sb->s_bdev->bd_disk->fops->direct_access) { 922 915 ext2_msg(sb, KERN_ERR, 923 - "error: device does not support xip"); 916 + "error: device does not support dax"); 924 917 goto failed_mount; 925 918 } 926 919 } ··· 1293 1286 ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); 1294 1287 1295 1288 es = sbi->s_es; 1296 - if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_XIP) { 1289 + if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_DAX) { 1297 1290 ext2_msg(sb, KERN_WARNING, "warning: refusing change of " 1298 - "xip flag with busy inodes while remounting"); 1299 - sbi->s_mount_opt ^= EXT2_MOUNT_XIP; 1291 + "dax flag with busy inodes while remounting"); 1292 + sbi->s_mount_opt ^= EXT2_MOUNT_DAX; 1300 1293 } 1301 1294 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { 1302 1295 spin_unlock(&sbi->s_lock);