diff options
Diffstat (limited to 'fs/ocfs2')
| -rw-r--r-- | fs/ocfs2/cluster/netdebug.c | 26 | ||||
| -rw-r--r-- | fs/ocfs2/cluster/tcp.c | 44 | ||||
| -rw-r--r-- | fs/ocfs2/cluster/tcp_internal.h | 32 | ||||
| -rw-r--r-- | fs/ocfs2/dir.c | 11 | ||||
| -rw-r--r-- | fs/ocfs2/journal.c | 23 | ||||
| -rw-r--r-- | fs/ocfs2/stackglue.c | 7 |
6 files changed, 76 insertions, 67 deletions
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index d8bfa0eb41b2..52276c02f710 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c | |||
| @@ -138,20 +138,20 @@ static int nst_seq_show(struct seq_file *seq, void *v) | |||
| 138 | " message id: %d\n" | 138 | " message id: %d\n" |
| 139 | " message type: %u\n" | 139 | " message type: %u\n" |
| 140 | " message key: 0x%08x\n" | 140 | " message key: 0x%08x\n" |
| 141 | " sock acquiry: %lu.%lu\n" | 141 | " sock acquiry: %lu.%ld\n" |
| 142 | " send start: %lu.%lu\n" | 142 | " send start: %lu.%ld\n" |
| 143 | " wait start: %lu.%lu\n", | 143 | " wait start: %lu.%ld\n", |
| 144 | nst, (unsigned long)nst->st_task->pid, | 144 | nst, (unsigned long)nst->st_task->pid, |
| 145 | (unsigned long)nst->st_task->tgid, | 145 | (unsigned long)nst->st_task->tgid, |
| 146 | nst->st_task->comm, nst->st_node, | 146 | nst->st_task->comm, nst->st_node, |
| 147 | nst->st_sc, nst->st_id, nst->st_msg_type, | 147 | nst->st_sc, nst->st_id, nst->st_msg_type, |
| 148 | nst->st_msg_key, | 148 | nst->st_msg_key, |
| 149 | nst->st_sock_time.tv_sec, | 149 | nst->st_sock_time.tv_sec, |
| 150 | (unsigned long)nst->st_sock_time.tv_usec, | 150 | (long)nst->st_sock_time.tv_usec, |
| 151 | nst->st_send_time.tv_sec, | 151 | nst->st_send_time.tv_sec, |
| 152 | (unsigned long)nst->st_send_time.tv_usec, | 152 | (long)nst->st_send_time.tv_usec, |
| 153 | nst->st_status_time.tv_sec, | 153 | nst->st_status_time.tv_sec, |
| 154 | nst->st_status_time.tv_usec); | 154 | (long)nst->st_status_time.tv_usec); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | spin_unlock(&o2net_debug_lock); | 157 | spin_unlock(&o2net_debug_lock); |
| @@ -276,7 +276,7 @@ static void *sc_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
| 276 | return sc; /* unused, just needs to be null when done */ | 276 | return sc; /* unused, just needs to be null when done */ |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | #define TV_SEC_USEC(TV) TV.tv_sec, (unsigned long)TV.tv_usec | 279 | #define TV_SEC_USEC(TV) TV.tv_sec, (long)TV.tv_usec |
| 280 | 280 | ||
| 281 | static int sc_seq_show(struct seq_file *seq, void *v) | 281 | static int sc_seq_show(struct seq_file *seq, void *v) |
| 282 | { | 282 | { |
| @@ -309,12 +309,12 @@ static int sc_seq_show(struct seq_file *seq, void *v) | |||
| 309 | " remote node: %s\n" | 309 | " remote node: %s\n" |
| 310 | " page off: %zu\n" | 310 | " page off: %zu\n" |
| 311 | " handshake ok: %u\n" | 311 | " handshake ok: %u\n" |
| 312 | " timer: %lu.%lu\n" | 312 | " timer: %lu.%ld\n" |
| 313 | " data ready: %lu.%lu\n" | 313 | " data ready: %lu.%ld\n" |
| 314 | " advance start: %lu.%lu\n" | 314 | " advance start: %lu.%ld\n" |
| 315 | " advance stop: %lu.%lu\n" | 315 | " advance stop: %lu.%ld\n" |
| 316 | " func start: %lu.%lu\n" | 316 | " func start: %lu.%ld\n" |
| 317 | " func stop: %lu.%lu\n" | 317 | " func stop: %lu.%ld\n" |
| 318 | " func key: %u\n" | 318 | " func key: %u\n" |
| 319 | " func type: %u\n", | 319 | " func type: %u\n", |
| 320 | sc, | 320 | sc, |
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index a27d61581bd6..2bcf706d9dd3 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
| @@ -143,8 +143,8 @@ static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); | |||
| 143 | static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc); | 143 | static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc); |
| 144 | 144 | ||
| 145 | #ifdef CONFIG_DEBUG_FS | 145 | #ifdef CONFIG_DEBUG_FS |
| 146 | void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, | 146 | static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, |
| 147 | u32 msgkey, struct task_struct *task, u8 node) | 147 | u32 msgkey, struct task_struct *task, u8 node) |
| 148 | { | 148 | { |
| 149 | INIT_LIST_HEAD(&nst->st_net_debug_item); | 149 | INIT_LIST_HEAD(&nst->st_net_debug_item); |
| 150 | nst->st_task = task; | 150 | nst->st_task = task; |
| @@ -153,31 +153,61 @@ void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, | |||
| 153 | nst->st_node = node; | 153 | nst->st_node = node; |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) | 156 | static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) |
| 157 | { | 157 | { |
| 158 | do_gettimeofday(&nst->st_sock_time); | 158 | do_gettimeofday(&nst->st_sock_time); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | void o2net_set_nst_send_time(struct o2net_send_tracking *nst) | 161 | static void o2net_set_nst_send_time(struct o2net_send_tracking *nst) |
| 162 | { | 162 | { |
| 163 | do_gettimeofday(&nst->st_send_time); | 163 | do_gettimeofday(&nst->st_send_time); |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | void o2net_set_nst_status_time(struct o2net_send_tracking *nst) | 166 | static void o2net_set_nst_status_time(struct o2net_send_tracking *nst) |
| 167 | { | 167 | { |
| 168 | do_gettimeofday(&nst->st_status_time); | 168 | do_gettimeofday(&nst->st_status_time); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, | 171 | static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, |
| 172 | struct o2net_sock_container *sc) | 172 | struct o2net_sock_container *sc) |
| 173 | { | 173 | { |
| 174 | nst->st_sc = sc; | 174 | nst->st_sc = sc; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id) | 177 | static void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id) |
| 178 | { | 178 | { |
| 179 | nst->st_id = msg_id; | 179 | nst->st_id = msg_id; |
| 180 | } | 180 | } |
| 181 | |||
| 182 | #else /* CONFIG_DEBUG_FS */ | ||
| 183 | |||
| 184 | static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, | ||
| 185 | u32 msgkey, struct task_struct *task, u8 node) | ||
| 186 | { | ||
| 187 | } | ||
| 188 | |||
| 189 | static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) | ||
| 190 | { | ||
| 191 | } | ||
| 192 | |||
| 193 | static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst) | ||
| 194 | { | ||
| 195 | } | ||
| 196 | |||
| 197 | static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst) | ||
| 198 | { | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, | ||
| 202 | struct o2net_sock_container *sc) | ||
| 203 | { | ||
| 204 | } | ||
| 205 | |||
| 206 | static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, | ||
| 207 | u32 msg_id) | ||
| 208 | { | ||
| 209 | } | ||
| 210 | |||
| 181 | #endif /* CONFIG_DEBUG_FS */ | 211 | #endif /* CONFIG_DEBUG_FS */ |
| 182 | 212 | ||
| 183 | static inline int o2net_reconnect_delay(void) | 213 | static inline int o2net_reconnect_delay(void) |
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h index 18307ff81b77..8d58cfe410b1 100644 --- a/fs/ocfs2/cluster/tcp_internal.h +++ b/fs/ocfs2/cluster/tcp_internal.h | |||
| @@ -224,42 +224,10 @@ struct o2net_send_tracking { | |||
| 224 | struct timeval st_send_time; | 224 | struct timeval st_send_time; |
| 225 | struct timeval st_status_time; | 225 | struct timeval st_status_time; |
| 226 | }; | 226 | }; |
| 227 | |||
| 228 | void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, | ||
| 229 | u32 msgkey, struct task_struct *task, u8 node); | ||
| 230 | void o2net_set_nst_sock_time(struct o2net_send_tracking *nst); | ||
| 231 | void o2net_set_nst_send_time(struct o2net_send_tracking *nst); | ||
| 232 | void o2net_set_nst_status_time(struct o2net_send_tracking *nst); | ||
| 233 | void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, | ||
| 234 | struct o2net_sock_container *sc); | ||
| 235 | void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id); | ||
| 236 | |||
| 237 | #else | 227 | #else |
| 238 | struct o2net_send_tracking { | 228 | struct o2net_send_tracking { |
| 239 | u32 dummy; | 229 | u32 dummy; |
| 240 | }; | 230 | }; |
| 241 | |||
| 242 | static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, | ||
| 243 | u32 msgkey, struct task_struct *task, u8 node) | ||
| 244 | { | ||
| 245 | } | ||
| 246 | static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) | ||
| 247 | { | ||
| 248 | } | ||
| 249 | static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst) | ||
| 250 | { | ||
| 251 | } | ||
| 252 | static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst) | ||
| 253 | { | ||
| 254 | } | ||
| 255 | static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, | ||
| 256 | struct o2net_sock_container *sc) | ||
| 257 | { | ||
| 258 | } | ||
| 259 | static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, | ||
| 260 | u32 msg_id) | ||
| 261 | { | ||
| 262 | } | ||
| 263 | #endif /* CONFIG_DEBUG_FS */ | 231 | #endif /* CONFIG_DEBUG_FS */ |
| 264 | 232 | ||
| 265 | #endif /* O2CLUSTER_TCP_INTERNAL_H */ | 233 | #endif /* O2CLUSTER_TCP_INTERNAL_H */ |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8a1875848080..9cce563fd627 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
| @@ -1300,7 +1300,6 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
| 1300 | di->i_size = cpu_to_le64(sb->s_blocksize); | 1300 | di->i_size = cpu_to_le64(sb->s_blocksize); |
| 1301 | di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); | 1301 | di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); |
| 1302 | di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec); | 1302 | di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec); |
| 1303 | dir->i_blocks = ocfs2_inode_sector_count(dir); | ||
| 1304 | 1303 | ||
| 1305 | /* | 1304 | /* |
| 1306 | * This should never fail as our extent list is empty and all | 1305 | * This should never fail as our extent list is empty and all |
| @@ -1310,9 +1309,15 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
| 1310 | NULL); | 1309 | NULL); |
| 1311 | if (ret) { | 1310 | if (ret) { |
| 1312 | mlog_errno(ret); | 1311 | mlog_errno(ret); |
| 1313 | goto out; | 1312 | goto out_commit; |
| 1314 | } | 1313 | } |
| 1315 | 1314 | ||
| 1315 | /* | ||
| 1316 | * Set i_blocks after the extent insert for the most up to | ||
| 1317 | * date ip_clusters value. | ||
| 1318 | */ | ||
| 1319 | dir->i_blocks = ocfs2_inode_sector_count(dir); | ||
| 1320 | |||
| 1316 | ret = ocfs2_journal_dirty(handle, di_bh); | 1321 | ret = ocfs2_journal_dirty(handle, di_bh); |
| 1317 | if (ret) { | 1322 | if (ret) { |
| 1318 | mlog_errno(ret); | 1323 | mlog_errno(ret); |
| @@ -1336,7 +1341,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
| 1336 | len, 0, NULL); | 1341 | len, 0, NULL); |
| 1337 | if (ret) { | 1342 | if (ret) { |
| 1338 | mlog_errno(ret); | 1343 | mlog_errno(ret); |
| 1339 | goto out; | 1344 | goto out_commit; |
| 1340 | } | 1345 | } |
| 1341 | } | 1346 | } |
| 1342 | 1347 | ||
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 7a37240f7a31..c47bc2a809c2 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
| @@ -1418,13 +1418,13 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb) | |||
| 1418 | { | 1418 | { |
| 1419 | unsigned int node_num; | 1419 | unsigned int node_num; |
| 1420 | int status, i; | 1420 | int status, i; |
| 1421 | u32 gen; | ||
| 1421 | struct buffer_head *bh = NULL; | 1422 | struct buffer_head *bh = NULL; |
| 1422 | struct ocfs2_dinode *di; | 1423 | struct ocfs2_dinode *di; |
| 1423 | 1424 | ||
| 1424 | /* This is called with the super block cluster lock, so we | 1425 | /* This is called with the super block cluster lock, so we |
| 1425 | * know that the slot map can't change underneath us. */ | 1426 | * know that the slot map can't change underneath us. */ |
| 1426 | 1427 | ||
| 1427 | spin_lock(&osb->osb_lock); | ||
| 1428 | for (i = 0; i < osb->max_slots; i++) { | 1428 | for (i = 0; i < osb->max_slots; i++) { |
| 1429 | /* Read journal inode to get the recovery generation */ | 1429 | /* Read journal inode to get the recovery generation */ |
| 1430 | status = ocfs2_read_journal_inode(osb, i, &bh, NULL); | 1430 | status = ocfs2_read_journal_inode(osb, i, &bh, NULL); |
| @@ -1433,23 +1433,31 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb) | |||
| 1433 | goto bail; | 1433 | goto bail; |
| 1434 | } | 1434 | } |
| 1435 | di = (struct ocfs2_dinode *)bh->b_data; | 1435 | di = (struct ocfs2_dinode *)bh->b_data; |
| 1436 | osb->slot_recovery_generations[i] = | 1436 | gen = ocfs2_get_recovery_generation(di); |
| 1437 | ocfs2_get_recovery_generation(di); | ||
| 1438 | brelse(bh); | 1437 | brelse(bh); |
| 1439 | bh = NULL; | 1438 | bh = NULL; |
| 1440 | 1439 | ||
| 1440 | spin_lock(&osb->osb_lock); | ||
| 1441 | osb->slot_recovery_generations[i] = gen; | ||
| 1442 | |||
| 1441 | mlog(0, "Slot %u recovery generation is %u\n", i, | 1443 | mlog(0, "Slot %u recovery generation is %u\n", i, |
| 1442 | osb->slot_recovery_generations[i]); | 1444 | osb->slot_recovery_generations[i]); |
| 1443 | 1445 | ||
| 1444 | if (i == osb->slot_num) | 1446 | if (i == osb->slot_num) { |
| 1447 | spin_unlock(&osb->osb_lock); | ||
| 1445 | continue; | 1448 | continue; |
| 1449 | } | ||
| 1446 | 1450 | ||
| 1447 | status = ocfs2_slot_to_node_num_locked(osb, i, &node_num); | 1451 | status = ocfs2_slot_to_node_num_locked(osb, i, &node_num); |
| 1448 | if (status == -ENOENT) | 1452 | if (status == -ENOENT) { |
| 1453 | spin_unlock(&osb->osb_lock); | ||
| 1449 | continue; | 1454 | continue; |
| 1455 | } | ||
| 1450 | 1456 | ||
| 1451 | if (__ocfs2_recovery_map_test(osb, node_num)) | 1457 | if (__ocfs2_recovery_map_test(osb, node_num)) { |
| 1458 | spin_unlock(&osb->osb_lock); | ||
| 1452 | continue; | 1459 | continue; |
| 1460 | } | ||
| 1453 | spin_unlock(&osb->osb_lock); | 1461 | spin_unlock(&osb->osb_lock); |
| 1454 | 1462 | ||
| 1455 | /* Ok, we have a slot occupied by another node which | 1463 | /* Ok, we have a slot occupied by another node which |
| @@ -1465,10 +1473,7 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb) | |||
| 1465 | mlog_errno(status); | 1473 | mlog_errno(status); |
| 1466 | goto bail; | 1474 | goto bail; |
| 1467 | } | 1475 | } |
| 1468 | |||
| 1469 | spin_lock(&osb->osb_lock); | ||
| 1470 | } | 1476 | } |
| 1471 | spin_unlock(&osb->osb_lock); | ||
| 1472 | 1477 | ||
| 1473 | status = 0; | 1478 | status = 0; |
| 1474 | bail: | 1479 | bail: |
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 10e149ae5e3a..07f348b8d721 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c | |||
| @@ -97,13 +97,14 @@ static int ocfs2_stack_driver_request(const char *stack_name, | |||
| 97 | goto out; | 97 | goto out; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | /* Ok, the stack is pinned */ | ||
| 101 | p->sp_count++; | ||
| 102 | active_stack = p; | 100 | active_stack = p; |
| 103 | |||
| 104 | rc = 0; | 101 | rc = 0; |
| 105 | 102 | ||
| 106 | out: | 103 | out: |
| 104 | /* If we found it, pin it */ | ||
| 105 | if (!rc) | ||
| 106 | active_stack->sp_count++; | ||
| 107 | |||
| 107 | spin_unlock(&ocfs2_stack_lock); | 108 | spin_unlock(&ocfs2_stack_lock); |
| 108 | return rc; | 109 | return rc; |
| 109 | } | 110 | } |
