Re: [PATCH 4/5] xfs: introduce background inode reclaim work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +void
> +xfs_syncd_queue_reclaim(
> +	struct xfs_mount        *mp,
> +	int			flags)
> +{
> +	mutex_lock(&xfs_syncd_lock);
> +	if (!delayed_work_pending(&mp->m_reclaim_work))
> +		queue_delayed_work(xfs_syncd_wq, &mp->m_reclaim_work,
> +			xfs_syncd_centisecs / 5 * msecs_to_jiffies(10));
> +	mutex_unlock(&xfs_syncd_lock);
> +
> +	if (flags & SYNC_WAIT)
> +		flush_delayed_work_sync(&mp->m_reclaim_work);
> +}

queue_work/queue_delayed_work have a test_set_bit on
WORK_STRUCT_PENDING_BIT, so can just call queue_work/queue_delayed_work
and it will do the right thing if it is in use.  So you can remove the
mutex and delayed_work_pending check here.

At least currently SYNC_WAIT is never set by any caller, and I wonder if
we should just leave the waiting to the caller if we ever grow one.

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux