aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/multipath/g_multipath.h
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2011-11-12 09:52:27 +0000
committerAlexander Motin <mav@FreeBSD.org>2011-11-12 09:52:27 +0000
commit0c883cef45bbfe73888046245dfcdb7aed5a40ea (patch)
tree0622aaa5c43910a8496b98bb26e1579394619778 /sys/geom/multipath/g_multipath.h
parent17c78d345c9c227479712f4e291473301e024689 (diff)
downloadsrc-0c883cef45bbfe73888046245dfcdb7aed5a40ea.tar.gz
src-0c883cef45bbfe73888046245dfcdb7aed5a40ea.zip
Major GEOM MULTIPATH class rewrite:
- Improved locking and destruction process to fix crashes. - Improved "automatic" configuration method to make it consistent and safe by reading metadata back from all specified paths after writing to one. - Added provider size check to reduce chance of ordering conflict with other GEOM classes. - Added "manual" configuration method without using on-disk metadata. - Added "add" and "remove" commands to allow manage paths manually. - Failed paths are no longer dropped from geom, but only marked as FAIL and excluded from I/O operations. - Automatically restore failed paths when all others paths are marked as failed, for example, because of device-caused (not transport) errors. - Added "fail" and "restore" commands to manually control FAIL flag. - geom is now destroyed on last path disconnection. - Added optional Active/Active mode support. Unlike Active/Passive mode, load evenly distributed between all working paths. If supported by the device, it allows to significantly improve performance, utilizing bandwidth of all paths. It is controlled by -A option during creation. Disabled by default now. - Improved `status` and `list` commands output. Sponsored by: iXsystems, inc. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=227464
Diffstat (limited to 'sys/geom/multipath/g_multipath.h')
-rw-r--r--sys/geom/multipath/g_multipath.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/geom/multipath/g_multipath.h b/sys/geom/multipath/g_multipath.h
index 22d6157250ae..33c44f1062ed 100644
--- a/sys/geom/multipath/g_multipath.h
+++ b/sys/geom/multipath/g_multipath.h
@@ -43,10 +43,15 @@
#ifdef _KERNEL
struct g_multipath_softc {
- struct g_provider * pp;
- struct g_consumer * cp_active;
+ struct g_provider * sc_pp;
+ struct g_consumer * sc_active;
+ struct mtx sc_mtx;
char sc_name[16];
char sc_uuid[40];
+ int sc_opened;
+ int sc_stopping;
+ int sc_ndisks;
+ int sc_active_active; /* Active/Active mode */
};
#endif /* _KERNEL */
@@ -57,6 +62,7 @@ struct g_multipath_metadata {
uint32_t md_version; /* version */
uint32_t md_sectorsize; /* sectorsize of provider */
uint64_t md_size; /* absolute size of provider */
+ uint8_t md_active_active; /* Active/Active mode */
};
static __inline void
@@ -79,6 +85,8 @@ multipath_metadata_encode(const struct g_multipath_metadata *md, u_char *data)
le32enc(data, md->md_sectorsize);
data += sizeof(md->md_sectorsize);
le64enc(data, md->md_size);
+ data += sizeof(md->md_size);
+ *data = md->md_active_active;
}
static __inline void
@@ -95,5 +103,7 @@ multipath_metadata_decode(u_char *data, struct g_multipath_metadata *md)
md->md_sectorsize = le32dec(data);
data += sizeof(md->md_sectorsize);
md->md_size = le64dec(data);
+ data += sizeof(md->md_size);
+ md->md_active_active = *data;
}
#endif /* _G_MULTIPATH_H_ */