Skip to content

Commit 4f5957a

Browse files
committed
dlm: change list and timer names
The old terminology of "toss" and "keep" is no longer an accurate description of the rsb states and lists, so change the names to "inactive" and "active". The old names had also been copied into the scanning code, which is changed back to use the "scan" name. - "active" rsb structs have lkb's attached, and are ref counted. - "inactive" rsb structs have no lkb's attached, are not ref counted. - "scan" list is for rsb's that can be freed after a timeout period. - "slow" lists are for infrequent iterations through active or inactive rsb structs. - inactive rsb structs that are directory records will not be put on the scan list, since they are not freed based on timeouts. - inactive rsb structs that are not directory records will be put on the scan list to be freed, since they are not longer needed. Signed-off-by: David Teigland <[email protected]>
1 parent fa0b54f commit 4f5957a

File tree

9 files changed

+182
-219
lines changed

9 files changed

+182
-219
lines changed

fs/dlm/debug_fs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static const struct seq_operations format4_seq_ops;
380380

381381
static int table_seq_show(struct seq_file *seq, void *iter_ptr)
382382
{
383-
struct dlm_rsb *rsb = list_entry(iter_ptr, struct dlm_rsb, res_rsbs_list);
383+
struct dlm_rsb *rsb = list_entry(iter_ptr, struct dlm_rsb, res_slow_list);
384384

385385
if (seq->op == &format1_seq_ops)
386386
print_format1(rsb, seq);
@@ -409,9 +409,9 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos)
409409
}
410410

411411
if (seq->op == &format4_seq_ops)
412-
list = &ls->ls_toss;
412+
list = &ls->ls_slow_inactive;
413413
else
414-
list = &ls->ls_keep;
414+
list = &ls->ls_slow_active;
415415

416416
read_lock_bh(&ls->ls_rsbtbl_lock);
417417
return seq_list_start(list, *pos);
@@ -423,9 +423,9 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos)
423423
struct list_head *list;
424424

425425
if (seq->op == &format4_seq_ops)
426-
list = &ls->ls_toss;
426+
list = &ls->ls_slow_inactive;
427427
else
428-
list = &ls->ls_keep;
428+
list = &ls->ls_slow_active;
429429

430430
return seq_list_next(iter_ptr, list, pos);
431431
}

fs/dlm/dlm_internal.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ struct dlm_rsb {
327327
struct list_head res_convertqueue;
328328
struct list_head res_waitqueue;
329329

330-
struct list_head res_rsbs_list;
330+
struct list_head res_slow_list; /* ls_slow_* */
331+
struct list_head res_scan_list;
331332
struct list_head res_root_list; /* used for recovery */
332333
struct list_head res_masters_list; /* used for recovery */
333334
struct list_head res_recover_list; /* used for recovery */
334-
struct list_head res_toss_q_list;
335335
int res_recover_locks_count;
336336

337337
char *res_lvbptr;
@@ -365,7 +365,7 @@ enum rsb_flags {
365365
RSB_RECOVER_CONVERT,
366366
RSB_RECOVER_GRANT,
367367
RSB_RECOVER_LVB_INVAL,
368-
RSB_TOSS,
368+
RSB_INACTIVE,
369369
};
370370

371371
static inline void rsb_set_flag(struct dlm_rsb *r, enum rsb_flags flag)
@@ -572,20 +572,16 @@ struct dlm_ls {
572572
struct xarray ls_lkbxa;
573573
rwlock_t ls_lkbxa_lock;
574574

575+
/* an rsb is on rsbtl for primary locking functions,
576+
and on a slow list for recovery/dump iteration */
575577
struct rhashtable ls_rsbtbl;
576-
rwlock_t ls_rsbtbl_lock;
577-
578-
struct list_head ls_toss;
579-
struct list_head ls_keep;
580-
581-
struct timer_list ls_timer;
582-
/* this queue is ordered according the
583-
* absolute res_toss_time jiffies time
584-
* to mod_timer() with the first element
585-
* if necessary.
586-
*/
587-
struct list_head ls_toss_q;
588-
spinlock_t ls_toss_q_lock;
578+
rwlock_t ls_rsbtbl_lock; /* for ls_rsbtbl and ls_slow */
579+
struct list_head ls_slow_inactive; /* to iterate rsbtbl */
580+
struct list_head ls_slow_active; /* to iterate rsbtbl */
581+
582+
struct timer_list ls_scan_timer; /* based on first scan_list rsb toss_time */
583+
struct list_head ls_scan_list; /* rsbs ordered by res_toss_time */
584+
spinlock_t ls_scan_lock;
589585

590586
spinlock_t ls_waiters_lock;
591587
struct list_head ls_waiters; /* lkbs needing a reply */

0 commit comments

Comments
 (0)