aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_dmops.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 09:04:11 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 09:04:11 -0700
commit347c53dca73fca317d57781f510f5ff4f6c0d0d7 (patch)
treecdc405ac049751da4d76085ce58750b6b2a22326 /fs/xfs/xfs_dmops.c
parent5c8e191e8437616a498a8e1cc0af3dd0d32bbff2 (diff)
parent7f015072348a14f16d548be557ee58c5c55df0aa (diff)
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6: (59 commits) [XFS] eagerly remove vmap mappings to avoid upsetting Xen [XFS] simplify validata_fields [XFS] no longer using io_vnode, as was remaining from 23 cherrypick [XFS] Remove STATIC which was missing from prior manual merge [XFS] Put back the QUEUE_ORDERED_NONE test in the barrier check. [XFS] Turn off XBF_ASYNC flag before re-reading superblock. [XFS] avoid race in sync_inodes() that can fail to write out all dirty data [XFS] This fix prevents bulkstat from spinning in an infinite loop. [XFS] simplify xfs_create/mknod/symlink prototype [XFS] avoid xfs_getattr in XFS_IOC_FSGETXATTR ioctl [XFS] get_bulkall() could return incorrect inode state [XFS] Kill unused IOMAP_EOF flag [XFS] fix when DMAPI mount option processing happens [XFS] ensure file size is logged on synchronous writes [XFS] growlock should be a mutex [XFS] replace some large xfs_log_priv.h macros by proper functions [XFS] kill struct bhv_vfs [XFS] move syncing related members from struct bhv_vfs to struct xfs_mount [XFS] kill the vfs_flags member in struct bhv_vfs [XFS] kill the vfs_fsid and vfs_altfsid members in struct bhv_vfs ...
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 1e4a35ddf7f..6cd5704258a 100644
--- a/fs/xfs/xfs_dmops.c
+++ b/fs/xfs/xfs_dmops.c
@@ -19,18 +19,51 @@
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_log.h"
-#include "xfs_inum.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
-#include "xfs_ag.h"
-#include "xfs_dir2.h"
#include "xfs_dmapi.h"
+#include "xfs_inum.h"
+#include "xfs_ag.h"
#include "xfs_mount.h"
+#include "xfs_clnt.h"
+
-xfs_dmops_t xfs_dmcore_stub = {
+static struct xfs_dmops xfs_dmcore_stub = {
.xfs_send_data = (xfs_send_data_t)fs_nosys,
.xfs_send_mmap = (xfs_send_mmap_t)fs_noerr,
.xfs_send_destroy = (xfs_send_destroy_t)fs_nosys,
.xfs_send_namesp = (xfs_send_namesp_t)fs_nosys,
- .xfs_send_unmount = (xfs_send_unmount_t)fs_noval,
+ .xfs_send_mount = (xfs_send_mount_t)fs_nosys,
+ .xfs_send_unmount = (xfs_send_unmount_t)fs_noerr,
};
+
+int
+xfs_dmops_get(struct xfs_mount *mp, struct xfs_mount_args *args)
+{
+ if (args->flags & XFSMNT_DMAPI) {
+ struct xfs_dmops *ops;
+
+ ops = symbol_get(xfs_dmcore_xfs);
+ if (!ops) {
+ request_module("xfs_dmapi");
+ ops = symbol_get(xfs_dmcore_xfs);
+ }
+
+ if (!ops) {
+ cmn_err(CE_WARN, "XFS: no dmapi support available.");
+ return EINVAL;
+ }
+ mp->m_dm_ops = ops;
+ } else {
+ mp->m_dm_ops = &xfs_dmcore_stub;
+ }
+
+ return 0;
+}
+
+void
+xfs_dmops_put(struct xfs_mount *mp)
+{
+ if (mp->m_dm_ops != &xfs_dmcore_stub)
+ symbol_put(xfs_dmcore_xfs);
+}