Re: [PATCH 7/7] writeback: Avoid iput() from flusher thread

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

 



> +/*
> + * Sleep until I_SYNC is cleared. This function must be called with i_lock
> + * held and drops it. It is aimed for callers not holding any inode reference
> + * so once i_lock is dropped, inode can go away.
> + */
> +static void inode_sleep_on_writeback(struct inode *inode)
> +	__releases(inode->i_lock)
> +{
> +	DEFINE_WAIT(wait);
> +	wait_queue_head_t *wqh = bit_waitqueue(&inode->i_state, __I_SYNC);
> +	int sleep;

i_state is "unsigned long", it's better to use the same type.

> +
> +	prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
> +	sleep = inode->i_state & I_SYNC;
> +	spin_unlock(&inode->i_lock);
> +	if (sleep)
> +		schedule();
> +	finish_wait(wqh, &wait);
> +}
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux