diff options
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/cluster/masklog.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/cluster/masklog.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/cluster/sys.c | 83 | ||||
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 24 | ||||
-rw-r--r-- | fs/ocfs2/cluster/tcp.h | 4 | ||||
-rw-r--r-- | fs/ocfs2/cluster/tcp_internal.h | 8 | ||||
-rw-r--r-- | fs/ocfs2/cluster/ver.c | 2 |
9 files changed, 44 insertions, 87 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 9cc7c0418b70..f02ccb34604d 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -267,7 +267,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, | |||
267 | current_page = cs / spp; | 267 | current_page = cs / spp; |
268 | page = reg->hr_slot_data[current_page]; | 268 | page = reg->hr_slot_data[current_page]; |
269 | 269 | ||
270 | vec_len = min(PAGE_CACHE_SIZE, | 270 | vec_len = min(PAGE_CACHE_SIZE - vec_start, |
271 | (max_slots-cs) * (PAGE_CACHE_SIZE/spp) ); | 271 | (max_slots-cs) * (PAGE_CACHE_SIZE/spp) ); |
272 | 272 | ||
273 | mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n", | 273 | mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n", |
diff --git a/fs/ocfs2/cluster/heartbeat.h b/fs/ocfs2/cluster/heartbeat.h index 35397dd5ecdb..e511339886b3 100644 --- a/fs/ocfs2/cluster/heartbeat.h +++ b/fs/ocfs2/cluster/heartbeat.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define O2HB_LIVE_THRESHOLD 2 | 35 | #define O2HB_LIVE_THRESHOLD 2 |
36 | /* number of equal samples to be seen as dead */ | 36 | /* number of equal samples to be seen as dead */ |
37 | extern unsigned int o2hb_dead_threshold; | 37 | extern unsigned int o2hb_dead_threshold; |
38 | #define O2HB_DEFAULT_DEAD_THRESHOLD 7 | 38 | #define O2HB_DEFAULT_DEAD_THRESHOLD 31 |
39 | /* Otherwise MAX_WRITE_TIMEOUT will be zero... */ | 39 | /* Otherwise MAX_WRITE_TIMEOUT will be zero... */ |
40 | #define O2HB_MIN_DEAD_THRESHOLD 2 | 40 | #define O2HB_MIN_DEAD_THRESHOLD 2 |
41 | #define O2HB_MAX_WRITE_TIMEOUT_MS (O2HB_REGION_TIMEOUT_MS * (o2hb_dead_threshold - 1)) | 41 | #define O2HB_MAX_WRITE_TIMEOUT_MS (O2HB_REGION_TIMEOUT_MS * (o2hb_dead_threshold - 1)) |
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c index a4882c8df945..23c732f27529 100644 --- a/fs/ocfs2/cluster/masklog.c +++ b/fs/ocfs2/cluster/masklog.c | |||
@@ -146,7 +146,7 @@ static struct kset mlog_kset = { | |||
146 | .kobj = {.ktype = &mlog_ktype}, | 146 | .kobj = {.ktype = &mlog_ktype}, |
147 | }; | 147 | }; |
148 | 148 | ||
149 | int mlog_sys_init(struct kset *o2cb_subsys) | 149 | int mlog_sys_init(struct kset *o2cb_kset) |
150 | { | 150 | { |
151 | int i = 0; | 151 | int i = 0; |
152 | 152 | ||
@@ -157,7 +157,7 @@ int mlog_sys_init(struct kset *o2cb_subsys) | |||
157 | mlog_attr_ptrs[i] = NULL; | 157 | mlog_attr_ptrs[i] = NULL; |
158 | 158 | ||
159 | kobject_set_name(&mlog_kset.kobj, "logmask"); | 159 | kobject_set_name(&mlog_kset.kobj, "logmask"); |
160 | kobj_set_kset_s(&mlog_kset, *o2cb_subsys); | 160 | mlog_kset.kobj.kset = o2cb_kset; |
161 | return kset_register(&mlog_kset); | 161 | return kset_register(&mlog_kset); |
162 | } | 162 | } |
163 | 163 | ||
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h index cd046060114e..597e064bb94f 100644 --- a/fs/ocfs2/cluster/masklog.h +++ b/fs/ocfs2/cluster/masklog.h | |||
@@ -212,7 +212,7 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits; | |||
212 | #define mlog_errno(st) do { \ | 212 | #define mlog_errno(st) do { \ |
213 | int _st = (st); \ | 213 | int _st = (st); \ |
214 | if (_st != -ERESTARTSYS && _st != -EINTR && \ | 214 | if (_st != -ERESTARTSYS && _st != -EINTR && \ |
215 | _st != AOP_TRUNCATED_PAGE) \ | 215 | _st != AOP_TRUNCATED_PAGE && _st != -ENOSPC) \ |
216 | mlog(ML_ERROR, "status = %lld\n", (long long)_st); \ | 216 | mlog(ML_ERROR, "status = %lld\n", (long long)_st); \ |
217 | } while (0) | 217 | } while (0) |
218 | 218 | ||
diff --git a/fs/ocfs2/cluster/sys.c b/fs/ocfs2/cluster/sys.c index 64f6f378fd09..0c095ce7723d 100644 --- a/fs/ocfs2/cluster/sys.c +++ b/fs/ocfs2/cluster/sys.c | |||
@@ -28,96 +28,55 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/kobject.h> | 29 | #include <linux/kobject.h> |
30 | #include <linux/sysfs.h> | 30 | #include <linux/sysfs.h> |
31 | #include <linux/fs.h> | ||
31 | 32 | ||
32 | #include "ocfs2_nodemanager.h" | 33 | #include "ocfs2_nodemanager.h" |
33 | #include "masklog.h" | 34 | #include "masklog.h" |
34 | #include "sys.h" | 35 | #include "sys.h" |
35 | 36 | ||
36 | struct o2cb_attribute { | ||
37 | struct attribute attr; | ||
38 | ssize_t (*show)(char *buf); | ||
39 | ssize_t (*store)(const char *buf, size_t count); | ||
40 | }; | ||
41 | |||
42 | #define O2CB_ATTR(_name, _mode, _show, _store) \ | ||
43 | struct o2cb_attribute o2cb_attr_##_name = __ATTR(_name, _mode, _show, _store) | ||
44 | |||
45 | #define to_o2cb_attr(_attr) container_of(_attr, struct o2cb_attribute, attr) | ||
46 | 37 | ||
47 | static ssize_t o2cb_interface_revision_show(char *buf) | 38 | static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr, |
39 | char *buf) | ||
48 | { | 40 | { |
49 | return snprintf(buf, PAGE_SIZE, "%u\n", O2NM_API_VERSION); | 41 | return snprintf(buf, PAGE_SIZE, "%u\n", O2NM_API_VERSION); |
50 | } | 42 | } |
51 | 43 | static struct kobj_attribute attr_version = | |
52 | static O2CB_ATTR(interface_revision, S_IFREG | S_IRUGO, o2cb_interface_revision_show, NULL); | 44 | __ATTR(interface_revision, S_IFREG | S_IRUGO, version_show, NULL); |
53 | 45 | ||
54 | static struct attribute *o2cb_attrs[] = { | 46 | static struct attribute *o2cb_attrs[] = { |
55 | &o2cb_attr_interface_revision.attr, | 47 | &attr_version.attr, |
56 | NULL, | 48 | NULL, |
57 | }; | 49 | }; |
58 | 50 | ||
59 | static ssize_t | 51 | static struct attribute_group o2cb_attr_group = { |
60 | o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer); | 52 | .attrs = o2cb_attrs, |
61 | static ssize_t | ||
62 | o2cb_store(struct kobject * kobj, struct attribute * attr, | ||
63 | const char * buffer, size_t count); | ||
64 | static struct sysfs_ops o2cb_sysfs_ops = { | ||
65 | .show = o2cb_show, | ||
66 | .store = o2cb_store, | ||
67 | }; | 53 | }; |
68 | 54 | ||
69 | static struct kobj_type o2cb_subsys_type = { | 55 | static struct kset *o2cb_kset; |
70 | .default_attrs = o2cb_attrs, | ||
71 | .sysfs_ops = &o2cb_sysfs_ops, | ||
72 | }; | ||
73 | |||
74 | /* gives us o2cb_subsys */ | ||
75 | static decl_subsys(o2cb, NULL, NULL); | ||
76 | |||
77 | static ssize_t | ||
78 | o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer) | ||
79 | { | ||
80 | struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr); | ||
81 | struct kset *sbs = to_kset(kobj); | ||
82 | |||
83 | BUG_ON(sbs != &o2cb_subsys); | ||
84 | |||
85 | if (o2cb_attr->show) | ||
86 | return o2cb_attr->show(buffer); | ||
87 | return -EIO; | ||
88 | } | ||
89 | |||
90 | static ssize_t | ||
91 | o2cb_store(struct kobject * kobj, struct attribute * attr, | ||
92 | const char * buffer, size_t count) | ||
93 | { | ||
94 | struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr); | ||
95 | struct kset *sbs = to_kset(kobj); | ||
96 | |||
97 | BUG_ON(sbs != &o2cb_subsys); | ||
98 | |||
99 | if (o2cb_attr->store) | ||
100 | return o2cb_attr->store(buffer, count); | ||
101 | return -EIO; | ||
102 | } | ||
103 | 56 | ||
104 | void o2cb_sys_shutdown(void) | 57 | void o2cb_sys_shutdown(void) |
105 | { | 58 | { |
106 | mlog_sys_shutdown(); | 59 | mlog_sys_shutdown(); |
107 | subsystem_unregister(&o2cb_subsys); | 60 | kset_unregister(o2cb_kset); |
108 | } | 61 | } |
109 | 62 | ||
110 | int o2cb_sys_init(void) | 63 | int o2cb_sys_init(void) |
111 | { | 64 | { |
112 | int ret; | 65 | int ret; |
113 | 66 | ||
114 | o2cb_subsys.kobj.ktype = &o2cb_subsys_type; | 67 | o2cb_kset = kset_create_and_add("o2cb", NULL, NULL); |
115 | ret = subsystem_register(&o2cb_subsys); | 68 | if (!o2cb_kset) |
69 | return -ENOMEM; | ||
70 | |||
71 | ret = sysfs_create_group(&o2cb_kset->kobj, &o2cb_attr_group); | ||
116 | if (ret) | 72 | if (ret) |
117 | return ret; | 73 | goto error; |
118 | 74 | ||
119 | ret = mlog_sys_init(&o2cb_subsys); | 75 | ret = mlog_sys_init(o2cb_kset); |
120 | if (ret) | 76 | if (ret) |
121 | subsystem_unregister(&o2cb_subsys); | 77 | goto error; |
78 | return 0; | ||
79 | error: | ||
80 | kset_unregister(o2cb_kset); | ||
122 | return ret; | 81 | return ret; |
123 | } | 82 | } |
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 685c18065c82..ee50c9610e7f 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <linux/slab.h> | 58 | #include <linux/slab.h> |
59 | #include <linux/idr.h> | 59 | #include <linux/idr.h> |
60 | #include <linux/kref.h> | 60 | #include <linux/kref.h> |
61 | #include <linux/net.h> | ||
61 | #include <net/tcp.h> | 62 | #include <net/tcp.h> |
62 | 63 | ||
63 | #include <asm/uaccess.h> | 64 | #include <asm/uaccess.h> |
@@ -71,14 +72,6 @@ | |||
71 | 72 | ||
72 | #include "tcp_internal.h" | 73 | #include "tcp_internal.h" |
73 | 74 | ||
74 | /* | ||
75 | * The linux network stack isn't sparse endian clean.. It has macros like | ||
76 | * ntohs() which perform the endian checks and structs like sockaddr_in | ||
77 | * which aren't annotated. So __force is found here to get the build | ||
78 | * clean. When they emerge from the dark ages and annotate the code | ||
79 | * we can remove these. | ||
80 | */ | ||
81 | |||
82 | #define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u" | 75 | #define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u" |
83 | #define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \ | 76 | #define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \ |
84 | NIPQUAD(sc->sc_node->nd_ipv4_address), \ | 77 | NIPQUAD(sc->sc_node->nd_ipv4_address), \ |
@@ -616,8 +609,7 @@ static void o2net_shutdown_sc(struct work_struct *work) | |||
616 | del_timer_sync(&sc->sc_idle_timeout); | 609 | del_timer_sync(&sc->sc_idle_timeout); |
617 | o2net_sc_cancel_delayed_work(sc, &sc->sc_keepalive_work); | 610 | o2net_sc_cancel_delayed_work(sc, &sc->sc_keepalive_work); |
618 | sc_put(sc); | 611 | sc_put(sc); |
619 | sc->sc_sock->ops->shutdown(sc->sc_sock, | 612 | kernel_sock_shutdown(sc->sc_sock, SHUT_RDWR); |
620 | RCV_SHUTDOWN|SEND_SHUTDOWN); | ||
621 | } | 613 | } |
622 | 614 | ||
623 | /* not fatal so failed connects before the other guy has our | 615 | /* not fatal so failed connects before the other guy has our |
@@ -1500,7 +1492,7 @@ static void o2net_start_connect(struct work_struct *work) | |||
1500 | 1492 | ||
1501 | myaddr.sin_family = AF_INET; | 1493 | myaddr.sin_family = AF_INET; |
1502 | myaddr.sin_addr.s_addr = mynode->nd_ipv4_address; | 1494 | myaddr.sin_addr.s_addr = mynode->nd_ipv4_address; |
1503 | myaddr.sin_port = (__force u16)htons(0); /* any port */ | 1495 | myaddr.sin_port = htons(0); /* any port */ |
1504 | 1496 | ||
1505 | ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, | 1497 | ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, |
1506 | sizeof(myaddr)); | 1498 | sizeof(myaddr)); |
@@ -1701,11 +1693,11 @@ static int o2net_accept_one(struct socket *sock) | |||
1701 | if (ret < 0) | 1693 | if (ret < 0) |
1702 | goto out; | 1694 | goto out; |
1703 | 1695 | ||
1704 | node = o2nm_get_node_by_ip((__force __be32)sin.sin_addr.s_addr); | 1696 | node = o2nm_get_node_by_ip(sin.sin_addr.s_addr); |
1705 | if (node == NULL) { | 1697 | if (node == NULL) { |
1706 | mlog(ML_NOTICE, "attempt to connect from unknown node at " | 1698 | mlog(ML_NOTICE, "attempt to connect from unknown node at " |
1707 | "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr), | 1699 | "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr), |
1708 | ntohs((__force __be16)sin.sin_port)); | 1700 | ntohs(sin.sin_port)); |
1709 | ret = -EINVAL; | 1701 | ret = -EINVAL; |
1710 | goto out; | 1702 | goto out; |
1711 | } | 1703 | } |
@@ -1714,7 +1706,7 @@ static int o2net_accept_one(struct socket *sock) | |||
1714 | mlog(ML_NOTICE, "unexpected connect attempted from a lower " | 1706 | mlog(ML_NOTICE, "unexpected connect attempted from a lower " |
1715 | "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n", | 1707 | "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n", |
1716 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), | 1708 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), |
1717 | ntohs((__force __be16)sin.sin_port), node->nd_num); | 1709 | ntohs(sin.sin_port), node->nd_num); |
1718 | ret = -EINVAL; | 1710 | ret = -EINVAL; |
1719 | goto out; | 1711 | goto out; |
1720 | } | 1712 | } |
@@ -1725,7 +1717,7 @@ static int o2net_accept_one(struct socket *sock) | |||
1725 | mlog(ML_CONN, "attempt to connect from node '%s' at " | 1717 | mlog(ML_CONN, "attempt to connect from node '%s' at " |
1726 | "%u.%u.%u.%u:%d but it isn't heartbeating\n", | 1718 | "%u.%u.%u.%u:%d but it isn't heartbeating\n", |
1727 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), | 1719 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), |
1728 | ntohs((__force __be16)sin.sin_port)); | 1720 | ntohs(sin.sin_port)); |
1729 | ret = -EINVAL; | 1721 | ret = -EINVAL; |
1730 | goto out; | 1722 | goto out; |
1731 | } | 1723 | } |
@@ -1742,7 +1734,7 @@ static int o2net_accept_one(struct socket *sock) | |||
1742 | mlog(ML_NOTICE, "attempt to connect from node '%s' at " | 1734 | mlog(ML_NOTICE, "attempt to connect from node '%s' at " |
1743 | "%u.%u.%u.%u:%d but it already has an open connection\n", | 1735 | "%u.%u.%u.%u:%d but it already has an open connection\n", |
1744 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), | 1736 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), |
1745 | ntohs((__force __be16)sin.sin_port)); | 1737 | ntohs(sin.sin_port)); |
1746 | goto out; | 1738 | goto out; |
1747 | } | 1739 | } |
1748 | 1740 | ||
diff --git a/fs/ocfs2/cluster/tcp.h b/fs/ocfs2/cluster/tcp.h index da880fc215f0..f36f66aab3dd 100644 --- a/fs/ocfs2/cluster/tcp.h +++ b/fs/ocfs2/cluster/tcp.h | |||
@@ -60,8 +60,8 @@ typedef void (o2net_post_msg_handler_func)(int status, void *data, | |||
60 | /* same as hb delay, we're waiting for another node to recognize our hb */ | 60 | /* same as hb delay, we're waiting for another node to recognize our hb */ |
61 | #define O2NET_RECONNECT_DELAY_MS_DEFAULT 2000 | 61 | #define O2NET_RECONNECT_DELAY_MS_DEFAULT 2000 |
62 | 62 | ||
63 | #define O2NET_KEEPALIVE_DELAY_MS_DEFAULT 5000 | 63 | #define O2NET_KEEPALIVE_DELAY_MS_DEFAULT 2000 |
64 | #define O2NET_IDLE_TIMEOUT_MS_DEFAULT 10000 | 64 | #define O2NET_IDLE_TIMEOUT_MS_DEFAULT 30000 |
65 | 65 | ||
66 | 66 | ||
67 | /* TODO: figure this out.... */ | 67 | /* TODO: figure this out.... */ |
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h index 9606111fe89d..b2e832aca567 100644 --- a/fs/ocfs2/cluster/tcp_internal.h +++ b/fs/ocfs2/cluster/tcp_internal.h | |||
@@ -38,6 +38,12 @@ | |||
38 | * locking semantics of the file system using the protocol. It should | 38 | * locking semantics of the file system using the protocol. It should |
39 | * be somewhere else, I'm sure, but right now it isn't. | 39 | * be somewhere else, I'm sure, but right now it isn't. |
40 | * | 40 | * |
41 | * New in version 10: | ||
42 | * - Meta/data locks combined | ||
43 | * | ||
44 | * New in version 9: | ||
45 | * - All votes removed | ||
46 | * | ||
41 | * New in version 8: | 47 | * New in version 8: |
42 | * - Replace delete inode votes with a cluster lock | 48 | * - Replace delete inode votes with a cluster lock |
43 | * | 49 | * |
@@ -60,7 +66,7 @@ | |||
60 | * - full 64 bit i_size in the metadata lock lvbs | 66 | * - full 64 bit i_size in the metadata lock lvbs |
61 | * - introduction of "rw" lock and pushing meta/data locking down | 67 | * - introduction of "rw" lock and pushing meta/data locking down |
62 | */ | 68 | */ |
63 | #define O2NET_PROTOCOL_VERSION 8ULL | 69 | #define O2NET_PROTOCOL_VERSION 10ULL |
64 | struct o2net_handshake { | 70 | struct o2net_handshake { |
65 | __be64 protocol_version; | 71 | __be64 protocol_version; |
66 | __be64 connector_id; | 72 | __be64 connector_id; |
diff --git a/fs/ocfs2/cluster/ver.c b/fs/ocfs2/cluster/ver.c index 7286c48bb30d..a56eee6abad3 100644 --- a/fs/ocfs2/cluster/ver.c +++ b/fs/ocfs2/cluster/ver.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #include "ver.h" | 29 | #include "ver.h" |
30 | 30 | ||
31 | #define CLUSTER_BUILD_VERSION "1.3.3" | 31 | #define CLUSTER_BUILD_VERSION "1.5.0" |
32 | 32 | ||
33 | #define VERSION_STR "OCFS2 Node Manager " CLUSTER_BUILD_VERSION | 33 | #define VERSION_STR "OCFS2 Node Manager " CLUSTER_BUILD_VERSION |
34 | 34 | ||