diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-02-01 18:03:57 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-04-18 11:56:05 -0400 |
commit | 286eaa95c5c5915a6b72cc3f0a2534161fd7928b (patch) | |
tree | dce03b619389cc5b5e2508b30ca3e1411401cf4e /fs/ocfs2/super.c | |
parent | e3dad42bf993a0f24eb6e46152356c9b119c15e8 (diff) |
ocfs2: Break out stackglue into modules.
We define the ocfs2_stack_plugin structure to represent a stack driver.
The o2cb stack code is split into stack_o2cb.c. This becomes the
ocfs2_stack_o2cb.ko module.
The stackglue generic functions are similarly split into the
ocfs2_stackglue.ko module. This module now provides an interface to
register drivers. The ocfs2_stack_o2cb driver registers itself. As
part of this interface, ocfs2_stackglue can load drivers on demand.
This is accomplished in ocfs2_cluster_connect().
ocfs2_cluster_disconnect() is now notified when a _hangup() is pending.
If a hangup is pending, it will not release the driver module and will
let _hangup() do that.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index b4a02a00665d..e27a0d47ea2b 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1186,7 +1186,7 @@ leave: | |||
1186 | 1186 | ||
1187 | static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) | 1187 | static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) |
1188 | { | 1188 | { |
1189 | int tmp; | 1189 | int tmp, hangup_needed = 0; |
1190 | struct ocfs2_super *osb = NULL; | 1190 | struct ocfs2_super *osb = NULL; |
1191 | char nodestr[8]; | 1191 | char nodestr[8]; |
1192 | 1192 | ||
@@ -1225,19 +1225,21 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) | |||
1225 | 1225 | ||
1226 | ocfs2_release_system_inodes(osb); | 1226 | ocfs2_release_system_inodes(osb); |
1227 | 1227 | ||
1228 | if (osb->cconn) | ||
1229 | ocfs2_dlm_shutdown(osb); | ||
1230 | |||
1231 | debugfs_remove(osb->osb_debug_root); | ||
1232 | |||
1233 | /* | 1228 | /* |
1234 | * This is a small hack to move ocfs2_hb_ctl into stackglue. | ||
1235 | * If we're dismounting due to mount error, mount.ocfs2 will clean | 1229 | * If we're dismounting due to mount error, mount.ocfs2 will clean |
1236 | * up heartbeat. If we're a local mount, there is no heartbeat. | 1230 | * up heartbeat. If we're a local mount, there is no heartbeat. |
1237 | * If we failed before we got a uuid_str yet, we can't stop | 1231 | * If we failed before we got a uuid_str yet, we can't stop |
1238 | * heartbeat. Otherwise, do it. | 1232 | * heartbeat. Otherwise, do it. |
1239 | */ | 1233 | */ |
1240 | if (!mnt_err && !ocfs2_mount_local(osb) && osb->uuid_str) | 1234 | if (!mnt_err && !ocfs2_mount_local(osb) && osb->uuid_str) |
1235 | hangup_needed = 1; | ||
1236 | |||
1237 | if (osb->cconn) | ||
1238 | ocfs2_dlm_shutdown(osb, hangup_needed); | ||
1239 | |||
1240 | debugfs_remove(osb->osb_debug_root); | ||
1241 | |||
1242 | if (hangup_needed) | ||
1241 | ocfs2_cluster_hangup(osb->uuid_str, strlen(osb->uuid_str)); | 1243 | ocfs2_cluster_hangup(osb->uuid_str, strlen(osb->uuid_str)); |
1242 | 1244 | ||
1243 | atomic_set(&osb->vol_state, VOLUME_DISMOUNTED); | 1245 | atomic_set(&osb->vol_state, VOLUME_DISMOUNTED); |