[patch 10/12] xfs: shared code for grant head wakeups
Ben Myers
bpm at sgi.com
Thu Feb 16 15:08:49 CST 2012
Replace xlog_reserveq_wake() and xlog_writeq_wake() with
xlog_grant_head_wake(), which takes a struct xlog_grant_head.
On Mon, Dec 12, 2011 at 09:13:57AM -0500, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch at lst.de>
>
> ---
> fs/xfs/xfs_log.c | 50 ++++++++++++++++++++------------------------------
> fs/xfs/xfs_trace.h | 1 -
> 2 files changed, 20 insertions(+), 31 deletions(-)
>
> Index: xfs/fs/xfs/xfs_log.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_log.c 2011-12-11 21:31:10.580621915 +0100
> +++ xfs/fs/xfs/xfs_log.c 2011-12-11 21:32:08.763640044 +0100
> @@ -171,49 +171,39 @@ xlog_grant_head_wake_all(
> spin_unlock(&head->lock);
> }
>
> -STATIC bool
> -xlog_reserveq_wake(
> +static inline int
> +xlog_ticket_reservation(
> struct log *log,
> - int *free_bytes)
> + struct xlog_grant_head *head,
> + struct xlog_ticket *tic)
> {
> - struct xlog_ticket *tic;
> - int need_bytes;
> -
> - list_for_each_entry(tic, &log->l_reserve_head.waiters, t_queue) {
> + if (head == &log->l_write_head) {
Maybe it would be better to test a bit in the xlog_grant_head. You
certainly have space since they are cacheline aligned... or take a bool
or flag to test.
Looks good.
Reviewed-by: Ben Myers <bpm at sgi.com>
More information about the xfs
mailing list