aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c67
1 files changed, 7 insertions, 60 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 80938c736c2..4c7b8f9f4de 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -25,7 +25,6 @@
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_dir2.h" 26#include "xfs_dir2.h"
27#include "xfs_alloc.h" 27#include "xfs_alloc.h"
28#include "xfs_dmapi.h"
29#include "xfs_quota.h" 28#include "xfs_quota.h"
30#include "xfs_mount.h" 29#include "xfs_mount.h"
31#include "xfs_bmap_btree.h" 30#include "xfs_bmap_btree.h"
@@ -116,9 +115,6 @@ mempool_t *xfs_ioend_pool;
116#define MNTOPT_GQUOTANOENF "gqnoenforce"/* group quota limit enforcement */ 115#define MNTOPT_GQUOTANOENF "gqnoenforce"/* group quota limit enforcement */
117#define MNTOPT_PQUOTANOENF "pqnoenforce"/* project quota limit enforcement */ 116#define MNTOPT_PQUOTANOENF "pqnoenforce"/* project quota limit enforcement */
118#define MNTOPT_QUOTANOENF "qnoenforce" /* same as uqnoenforce */ 117#define MNTOPT_QUOTANOENF "qnoenforce" /* same as uqnoenforce */
119#define MNTOPT_DMAPI "dmapi" /* DMI enabled (DMAPI / XDSM) */
120#define MNTOPT_XDSM "xdsm" /* DMI enabled (DMAPI / XDSM) */
121#define MNTOPT_DMI "dmi" /* DMI enabled (DMAPI / XDSM) */
122#define MNTOPT_DELAYLOG "delaylog" /* Delayed loging enabled */ 118#define MNTOPT_DELAYLOG "delaylog" /* Delayed loging enabled */
123#define MNTOPT_NODELAYLOG "nodelaylog" /* Delayed loging disabled */ 119#define MNTOPT_NODELAYLOG "nodelaylog" /* Delayed loging disabled */
124 120
@@ -172,15 +168,13 @@ suffix_strtoul(char *s, char **endp, unsigned int base)
172STATIC int 168STATIC int
173xfs_parseargs( 169xfs_parseargs(
174 struct xfs_mount *mp, 170 struct xfs_mount *mp,
175 char *options, 171 char *options)
176 char **mtpt)
177{ 172{
178 struct super_block *sb = mp->m_super; 173 struct super_block *sb = mp->m_super;
179 char *this_char, *value, *eov; 174 char *this_char, *value, *eov;
180 int dsunit = 0; 175 int dsunit = 0;
181 int dswidth = 0; 176 int dswidth = 0;
182 int iosize = 0; 177 int iosize = 0;
183 int dmapi_implies_ikeep = 1;
184 __uint8_t iosizelog = 0; 178 __uint8_t iosizelog = 0;
185 179
186 /* 180 /*
@@ -243,15 +237,10 @@ xfs_parseargs(
243 if (!mp->m_logname) 237 if (!mp->m_logname)
244 return ENOMEM; 238 return ENOMEM;
245 } else if (!strcmp(this_char, MNTOPT_MTPT)) { 239 } else if (!strcmp(this_char, MNTOPT_MTPT)) {
246 if (!value || !*value) { 240 cmn_err(CE_WARN,
247 cmn_err(CE_WARN, 241 "XFS: %s option not allowed on this system",
248 "XFS: %s option requires an argument", 242 this_char);
249 this_char); 243 return EINVAL;
250 return EINVAL;
251 }
252 *mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
253 if (!*mtpt)
254 return ENOMEM;
255 } else if (!strcmp(this_char, MNTOPT_RTDEV)) { 244 } else if (!strcmp(this_char, MNTOPT_RTDEV)) {
256 if (!value || !*value) { 245 if (!value || !*value) {
257 cmn_err(CE_WARN, 246 cmn_err(CE_WARN,
@@ -329,7 +318,6 @@ xfs_parseargs(
329 } else if (!strcmp(this_char, MNTOPT_IKEEP)) { 318 } else if (!strcmp(this_char, MNTOPT_IKEEP)) {
330 mp->m_flags |= XFS_MOUNT_IKEEP; 319 mp->m_flags |= XFS_MOUNT_IKEEP;
331 } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { 320 } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) {
332 dmapi_implies_ikeep = 0;
333 mp->m_flags &= ~XFS_MOUNT_IKEEP; 321 mp->m_flags &= ~XFS_MOUNT_IKEEP;
334 } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { 322 } else if (!strcmp(this_char, MNTOPT_LARGEIO)) {
335 mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; 323 mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE;
@@ -370,12 +358,6 @@ xfs_parseargs(
370 } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { 358 } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) {
371 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); 359 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE);
372 mp->m_qflags &= ~XFS_OQUOTA_ENFD; 360 mp->m_qflags &= ~XFS_OQUOTA_ENFD;
373 } else if (!strcmp(this_char, MNTOPT_DMAPI)) {
374 mp->m_flags |= XFS_MOUNT_DMAPI;
375 } else if (!strcmp(this_char, MNTOPT_XDSM)) {
376 mp->m_flags |= XFS_MOUNT_DMAPI;
377 } else if (!strcmp(this_char, MNTOPT_DMI)) {
378 mp->m_flags |= XFS_MOUNT_DMAPI;
379 } else if (!strcmp(this_char, MNTOPT_DELAYLOG)) { 361 } else if (!strcmp(this_char, MNTOPT_DELAYLOG)) {
380 mp->m_flags |= XFS_MOUNT_DELAYLOG; 362 mp->m_flags |= XFS_MOUNT_DELAYLOG;
381 cmn_err(CE_WARN, 363 cmn_err(CE_WARN,
@@ -430,12 +412,6 @@ xfs_parseargs(
430 return EINVAL; 412 return EINVAL;
431 } 413 }
432 414
433 if ((mp->m_flags & XFS_MOUNT_DMAPI) && (!*mtpt || *mtpt[0] == '\0')) {
434 printk("XFS: %s option needs the mount point option as well\n",
435 MNTOPT_DMAPI);
436 return EINVAL;
437 }
438
439 if ((dsunit && !dswidth) || (!dsunit && dswidth)) { 415 if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
440 cmn_err(CE_WARN, 416 cmn_err(CE_WARN,
441 "XFS: sunit and swidth must be specified together"); 417 "XFS: sunit and swidth must be specified together");
@@ -449,18 +425,6 @@ xfs_parseargs(
449 return EINVAL; 425 return EINVAL;
450 } 426 }
451 427
452 /*
453 * Applications using DMI filesystems often expect the
454 * inode generation number to be monotonically increasing.
455 * If we delete inode chunks we break this assumption, so
456 * keep unused inode chunks on disk for DMI filesystems
457 * until we come up with a better solution.
458 * Note that if "ikeep" or "noikeep" mount options are
459 * supplied, then they are honored.
460 */
461 if ((mp->m_flags & XFS_MOUNT_DMAPI) && dmapi_implies_ikeep)
462 mp->m_flags |= XFS_MOUNT_IKEEP;
463
464done: 428done:
465 if (!(mp->m_flags & XFS_MOUNT_NOALIGN)) { 429 if (!(mp->m_flags & XFS_MOUNT_NOALIGN)) {
466 /* 430 /*
@@ -542,7 +506,6 @@ xfs_showargs(
542 { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, 506 { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC },
543 { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, 507 { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 },
544 { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, 508 { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM },
545 { XFS_MOUNT_DMAPI, "," MNTOPT_DMAPI },
546 { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, 509 { XFS_MOUNT_GRPID, "," MNTOPT_GRPID },
547 { XFS_MOUNT_DELAYLOG, "," MNTOPT_DELAYLOG }, 510 { XFS_MOUNT_DELAYLOG, "," MNTOPT_DELAYLOG },
548 { 0, NULL } 511 { 0, NULL }
@@ -1207,8 +1170,6 @@ xfs_fs_put_super(
1207 xfs_sync_attr(mp, 0); 1170 xfs_sync_attr(mp, 0);
1208 } 1171 }
1209 1172
1210 XFS_SEND_PREUNMOUNT(mp);
1211
1212 /* 1173 /*
1213 * Blow away any referenced inode in the filestreams cache. 1174 * Blow away any referenced inode in the filestreams cache.
1214 * This can and will cause log traffic as inodes go inactive 1175 * This can and will cause log traffic as inodes go inactive
@@ -1218,14 +1179,11 @@ xfs_fs_put_super(
1218 1179
1219 XFS_bflush(mp->m_ddev_targp); 1180 XFS_bflush(mp->m_ddev_targp);
1220 1181
1221 XFS_SEND_UNMOUNT(mp);
1222
1223 xfs_unmountfs(mp); 1182 xfs_unmountfs(mp);
1224 xfs_freesb(mp); 1183 xfs_freesb(mp);
1225 xfs_inode_shrinker_unregister(mp); 1184 xfs_inode_shrinker_unregister(mp);
1226 xfs_icsb_destroy_counters(mp); 1185 xfs_icsb_destroy_counters(mp);
1227 xfs_close_devices(mp); 1186 xfs_close_devices(mp);
1228 xfs_dmops_put(mp);
1229 xfs_free_fsname(mp); 1187 xfs_free_fsname(mp);
1230 kfree(mp); 1188 kfree(mp);
1231} 1189}
@@ -1543,7 +1501,6 @@ xfs_fs_fill_super(
1543 struct inode *root; 1501 struct inode *root;
1544 struct xfs_mount *mp = NULL; 1502 struct xfs_mount *mp = NULL;
1545 int flags = 0, error = ENOMEM; 1503 int flags = 0, error = ENOMEM;
1546 char *mtpt = NULL;
1547 1504
1548 mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); 1505 mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
1549 if (!mp) 1506 if (!mp)
@@ -1559,7 +1516,7 @@ xfs_fs_fill_super(
1559 mp->m_super = sb; 1516 mp->m_super = sb;
1560 sb->s_fs_info = mp; 1517 sb->s_fs_info = mp;
1561 1518
1562 error = xfs_parseargs(mp, (char *)data, &mtpt); 1519 error = xfs_parseargs(mp, (char *)data);
1563 if (error) 1520 if (error)
1564 goto out_free_fsname; 1521 goto out_free_fsname;
1565 1522
@@ -1571,16 +1528,12 @@ xfs_fs_fill_super(
1571#endif 1528#endif
1572 sb->s_op = &xfs_super_operations; 1529 sb->s_op = &xfs_super_operations;
1573 1530
1574 error = xfs_dmops_get(mp);
1575 if (error)
1576 goto out_free_fsname;
1577
1578 if (silent) 1531 if (silent)
1579 flags |= XFS_MFSI_QUIET; 1532 flags |= XFS_MFSI_QUIET;
1580 1533
1581 error = xfs_open_devices(mp); 1534 error = xfs_open_devices(mp);
1582 if (error) 1535 if (error)
1583 goto out_put_dmops; 1536 goto out_free_fsname;
1584 1537
1585 if (xfs_icsb_init_counters(mp)) 1538 if (xfs_icsb_init_counters(mp))
1586 mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; 1539 mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB;
@@ -1608,8 +1561,6 @@ xfs_fs_fill_super(
1608 if (error) 1561 if (error)
1609 goto out_filestream_unmount; 1562 goto out_filestream_unmount;
1610 1563
1611 XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, mtpt, mp->m_fsname);
1612
1613 sb->s_magic = XFS_SB_MAGIC; 1564 sb->s_magic = XFS_SB_MAGIC;
1614 sb->s_blocksize = mp->m_sb.sb_blocksize; 1565 sb->s_blocksize = mp->m_sb.sb_blocksize;
1615 sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1; 1566 sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1;
@@ -1638,7 +1589,6 @@ xfs_fs_fill_super(
1638 1589
1639 xfs_inode_shrinker_register(mp); 1590 xfs_inode_shrinker_register(mp);
1640 1591
1641 kfree(mtpt);
1642 return 0; 1592 return 0;
1643 1593
1644 out_filestream_unmount: 1594 out_filestream_unmount:
@@ -1648,11 +1598,8 @@ xfs_fs_fill_super(
1648 out_destroy_counters: 1598 out_destroy_counters:
1649 xfs_icsb_destroy_counters(mp); 1599 xfs_icsb_destroy_counters(mp);
1650 xfs_close_devices(mp); 1600 xfs_close_devices(mp);
1651 out_put_dmops:
1652 xfs_dmops_put(mp);
1653 out_free_fsname: 1601 out_free_fsname:
1654 xfs_free_fsname(mp); 1602 xfs_free_fsname(mp);
1655 kfree(mtpt);
1656 kfree(mp); 1603 kfree(mp);
1657 out: 1604 out:
1658 return -error; 1605 return -error;