aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vfsops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-28 21:59:36 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 21:41:15 -0400
commit293688ec420f1160ed93ea4c7948ed5baf8bafa7 (patch)
tree3e342f759b3ae0499eedcb8f050dd2c4c1b48e93 /fs/xfs/xfs_vfsops.c
parentf541d270dbce375b7bd8cef466bdaf0cff945b45 (diff)
[XFS] remove dependency of the dmapi module on behaviors
Mount options are now parsed by the main XFS module and rejected if dmapi support is not available, and there is a new dm operation to send the mount event. SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29502a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r--fs/xfs/xfs_vfsops.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 8c0e02279249..1cf8f54d8aa9 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -326,6 +326,8 @@ xfs_start_flags(
326 if (ap->flags2 & XFSMNT2_FILESTREAMS) 326 if (ap->flags2 & XFSMNT2_FILESTREAMS)
327 mp->m_flags |= XFS_MOUNT_FILESTREAMS; 327 mp->m_flags |= XFS_MOUNT_FILESTREAMS;
328 328
329 if (ap->flags & XFSMNT_DMAPI)
330 vfs->vfs_flag |= VFS_DMI;
329 return 0; 331 return 0;
330} 332}
331 333
@@ -430,11 +432,13 @@ xfs_mount(
430 ddev = vfsp->vfs_super->s_bdev; 432 ddev = vfsp->vfs_super->s_bdev;
431 logdev = rtdev = NULL; 433 logdev = rtdev = NULL;
432 434
435 error = xfs_dmops_get(mp, args);
436 if (error)
437 return error;
438
433 /* 439 /*
434 * Setup xfs_mount function vectors from available behaviors 440 * Setup xfs_mount function vectors from available behaviors
435 */ 441 */
436 p = vfs_bhv_lookup(vfsp, VFS_POSITION_DM);
437 mp->m_dm_ops = p ? *(xfs_dmops_t *) vfs_bhv_custom(p) : xfs_dmcore_stub;
438 p = vfs_bhv_lookup(vfsp, VFS_POSITION_QM); 442 p = vfs_bhv_lookup(vfsp, VFS_POSITION_QM);
439 mp->m_qm_ops = p ? *(xfs_qmops_t *) vfs_bhv_custom(p) : xfs_qmcore_stub; 443 mp->m_qm_ops = p ? *(xfs_qmops_t *) vfs_bhv_custom(p) : xfs_qmcore_stub;
440 p = vfs_bhv_lookup(vfsp, VFS_POSITION_IO); 444 p = vfs_bhv_lookup(vfsp, VFS_POSITION_IO);
@@ -537,6 +541,8 @@ xfs_mount(
537 if (error) 541 if (error)
538 goto error2; 542 goto error2;
539 543
544 XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, args->mtpt, args->fsname);
545
540 return 0; 546 return 0;
541 547
542error2: 548error2:
@@ -550,6 +556,7 @@ error1:
550 xfs_binval(mp->m_rtdev_targp); 556 xfs_binval(mp->m_rtdev_targp);
551error0: 557error0:
552 xfs_unmountfs_close(mp, credp); 558 xfs_unmountfs_close(mp, credp);
559 xfs_dmops_put(mp);
553 return error; 560 return error;
554} 561}
555 562
@@ -640,6 +647,7 @@ out:
640 * and free the super block buffer & mount structures. 647 * and free the super block buffer & mount structures.
641 */ 648 */
642 xfs_unmountfs(mp, credp); 649 xfs_unmountfs(mp, credp);
650 xfs_dmops_put(mp);
643 kmem_free(mp, sizeof(xfs_mount_t)); 651 kmem_free(mp, sizeof(xfs_mount_t));
644 } 652 }
645 653
@@ -1688,6 +1696,9 @@ xfs_vget(
1688#define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ 1696#define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */
1689#define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */ 1697#define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */
1690#define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator */ 1698#define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator */
1699#define MNTOPT_DMAPI "dmapi" /* DMI enabled (DMAPI / XDSM) */
1700#define MNTOPT_XDSM "xdsm" /* DMI enabled (DMAPI / XDSM) */
1701#define MNTOPT_DMI "dmi" /* DMI enabled (DMAPI / XDSM) */
1691 1702
1692STATIC unsigned long 1703STATIC unsigned long
1693suffix_strtoul(char *s, char **endp, unsigned int base) 1704suffix_strtoul(char *s, char **endp, unsigned int base)
@@ -1878,6 +1889,12 @@ xfs_parseargs(
1878 args->flags &= ~XFSMNT_ATTR2; 1889 args->flags &= ~XFSMNT_ATTR2;
1879 } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { 1890 } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) {
1880 args->flags2 |= XFSMNT2_FILESTREAMS; 1891 args->flags2 |= XFSMNT2_FILESTREAMS;
1892 } else if (!strcmp(this_char, MNTOPT_DMAPI)) {
1893 args->flags |= XFSMNT_DMAPI;
1894 } else if (!strcmp(this_char, MNTOPT_XDSM)) {
1895 args->flags |= XFSMNT_DMAPI;
1896 } else if (!strcmp(this_char, MNTOPT_DMI)) {
1897 args->flags |= XFSMNT_DMAPI;
1881 } else if (!strcmp(this_char, "ihashsize")) { 1898 } else if (!strcmp(this_char, "ihashsize")) {
1882 cmn_err(CE_WARN, 1899 cmn_err(CE_WARN,
1883 "XFS: ihashsize no longer used, option is deprecated."); 1900 "XFS: ihashsize no longer used, option is deprecated.");
@@ -1909,6 +1926,12 @@ xfs_parseargs(
1909 return EINVAL; 1926 return EINVAL;
1910 } 1927 }
1911 1928
1929 if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') {
1930 printk("XFS: %s option needs the mount point option as well\n",
1931 MNTOPT_DMAPI);
1932 return EINVAL;
1933 }
1934
1912 if ((dsunit && !dswidth) || (!dsunit && dswidth)) { 1935 if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
1913 cmn_err(CE_WARN, 1936 cmn_err(CE_WARN,
1914 "XFS: sunit and swidth must be specified together"); 1937 "XFS: sunit and swidth must be specified together");
@@ -2002,6 +2025,9 @@ xfs_showargs(
2002 if (vfsp->vfs_flag & VFS_GRPID) 2025 if (vfsp->vfs_flag & VFS_GRPID)
2003 seq_printf(m, "," MNTOPT_GRPID); 2026 seq_printf(m, "," MNTOPT_GRPID);
2004 2027
2028 if (vfsp->vfs_flag & VFS_DMI)
2029 seq_puts(m, "," MNTOPT_DMAPI);
2030
2005 return 0; 2031 return 0;
2006} 2032}
2007 2033
@@ -2032,7 +2058,6 @@ bhv_vfsops_t xfs_vfsops = {
2032 .vfs_statvfs = xfs_statvfs, 2058 .vfs_statvfs = xfs_statvfs,
2033 .vfs_sync = xfs_sync, 2059 .vfs_sync = xfs_sync,
2034 .vfs_vget = xfs_vget, 2060 .vfs_vget = xfs_vget,
2035 .vfs_dmapiops = (vfs_dmapiops_t)fs_nosys,
2036 .vfs_quotactl = (vfs_quotactl_t)fs_nosys, 2061 .vfs_quotactl = (vfs_quotactl_t)fs_nosys,
2037 .vfs_init_vnode = xfs_initialize_vnode, 2062 .vfs_init_vnode = xfs_initialize_vnode,
2038 .vfs_force_shutdown = xfs_do_force_shutdown, 2063 .vfs_force_shutdown = xfs_do_force_shutdown,