aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dmops.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_dmops.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_dmops.c')
-rw-r--r--fs/xfs/xfs_dmops.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/fs/xfs/xfs_dmops.c b/fs/xfs/xfs_dmops.c
index 1e4a35ddf7f9..6cd5704258a2 100644
--- a/fs/xfs/xfs_dmops.c
+++ b/fs/xfs/xfs_dmops.c
@@ -19,18 +19,51 @@
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_types.h"
21#include "xfs_log.h" 21#include "xfs_log.h"
22#include "xfs_inum.h"
23#include "xfs_trans.h" 22#include "xfs_trans.h"
24#include "xfs_sb.h" 23#include "xfs_sb.h"
25#include "xfs_ag.h"
26#include "xfs_dir2.h"
27#include "xfs_dmapi.h" 24#include "xfs_dmapi.h"
25#include "xfs_inum.h"
26#include "xfs_ag.h"
28#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_clnt.h"
29
29 30
30xfs_dmops_t xfs_dmcore_stub = { 31static struct xfs_dmops xfs_dmcore_stub = {
31 .xfs_send_data = (xfs_send_data_t)fs_nosys, 32 .xfs_send_data = (xfs_send_data_t)fs_nosys,
32 .xfs_send_mmap = (xfs_send_mmap_t)fs_noerr, 33 .xfs_send_mmap = (xfs_send_mmap_t)fs_noerr,
33 .xfs_send_destroy = (xfs_send_destroy_t)fs_nosys, 34 .xfs_send_destroy = (xfs_send_destroy_t)fs_nosys,
34 .xfs_send_namesp = (xfs_send_namesp_t)fs_nosys, 35 .xfs_send_namesp = (xfs_send_namesp_t)fs_nosys,
35 .xfs_send_unmount = (xfs_send_unmount_t)fs_noval, 36 .xfs_send_mount = (xfs_send_mount_t)fs_nosys,
37 .xfs_send_unmount = (xfs_send_unmount_t)fs_noerr,
36}; 38};
39
40int
41xfs_dmops_get(struct xfs_mount *mp, struct xfs_mount_args *args)
42{
43 if (args->flags & XFSMNT_DMAPI) {
44 struct xfs_dmops *ops;
45
46 ops = symbol_get(xfs_dmcore_xfs);
47 if (!ops) {
48 request_module("xfs_dmapi");
49 ops = symbol_get(xfs_dmcore_xfs);
50 }
51
52 if (!ops) {
53 cmn_err(CE_WARN, "XFS: no dmapi support available.");
54 return EINVAL;
55 }
56 mp->m_dm_ops = ops;
57 } else {
58 mp->m_dm_ops = &xfs_dmcore_stub;
59 }
60
61 return 0;
62}
63
64void
65xfs_dmops_put(struct xfs_mount *mp)
66{
67 if (mp->m_dm_ops != &xfs_dmcore_stub)
68 symbol_put(xfs_dmcore_xfs);
69}