/* * AIL traversal cursor. * * Rather than using a generation number for detecting changes in the ail, use * a cursor that is protected by the ail lock. The aild cursor exists in the * struct xfs_ail, but other traversals can declare it on the stack and link it * to the ail list. * * When an object is deleted from or moved int the AIL, the cursor list is * searched to see if the object is a designated cursor item. If it is, it is * deleted from the cursor so that the next time the cursor is used traversal * will return to the start. * * This means a traversal colliding with a removal will cause a restart of the * list scan, rather than any insertion or deletion anywhere in the list. The * low bit of the item pointer is set if the cursor has been invalidated so * that we can tell the difference between invalidation and reaching the end * of the list to trigger traversal restarts.
*/ struct xfs_ail_cursor { struct list_head list; struct xfs_log_item *item;
};
/* * Private AIL structures. * * Eventually we need to drive the locking in here as well.
*/ struct xfs_ail { struct xlog *ail_log; struct task_struct *ail_task; struct list_head ail_head; struct list_head ail_cursors;
spinlock_t ail_lock;
xfs_lsn_t ail_last_pushed_lsn;
xfs_lsn_t ail_head_lsn; int ail_log_flush; unsignedlong ail_opstate; struct list_head ail_buf_list;
wait_queue_head_t ail_empty;
xfs_lsn_t ail_target;
};
/* Push all items out of the AIL immediately. */ #define XFS_AIL_OPSTATE_PUSH_ALL 0u
/* * From xfs_trans_ail.c
*/ void xfs_trans_ail_update_bulk(struct xfs_ail *ailp, struct xfs_ail_cursor *cur, struct xfs_log_item **log_items, int nr_items,
xfs_lsn_t lsn) __releases(ailp->ail_lock); /* * Return a pointer to the first item in the AIL. If the AIL is empty, then * return NULL.
*/ staticinlinestruct xfs_log_item *
xfs_ail_min( struct xfs_ail *ailp)
{ return list_first_entry_or_null(&ailp->ail_head, struct xfs_log_item,
li_ail);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.