On Thu, 25 Jan 2007 16:32:28 +0100 Peter Zijlstra <[email protected]> wrote: > +long congestion_wait_interruptible(int rw, long timeout) > +{ > + long ret; > + DEFINE_WAIT(wait); > + wait_queue_head_t *wqh = &congestion_wqh[rw]; > + > + prepare_to_wait(wqh, &wait, TASK_INTERRUPTIBLE); > + if (signal_pending(current)) > + ret = -ERESTARTSYS; > + else > + ret = io_schedule_timeout(timeout); > + finish_wait(wqh, &wait); > + return ret; > +} > +EXPORT_SYMBOL(congestion_wait_interruptible); I think this can share code with congestion_wait()? static long __congestion_wait(int rw, long timeout, int state) { long ret; DEFINE_WAIT(wait); wait_queue_head_t *wqh = &congestion_wqh[rw]; prepare_to_wait(wqh, &wait, state); ret = io_schedule_timeout(timeout); finish_wait(wqh, &wait); return ret; } long congestion_wait_interruptible(int rw, long timeout) { long ret = __congestion_wait(rw, timeout); if (signal_pending(current)) ret = -ERESTARTSYS; return ret; } it's only infinitesimally less efficient.. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] nfs: fix congestion control -v4
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control -v4
- References:
- [RFC 0/8] Cpuset aware writeback
- From: Christoph Lameter <[email protected]>
- Re: [RFC 0/8] Cpuset aware writeback
- From: Andrew Morton <[email protected]>
- [PATCH] nfs: fix congestion control
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Christoph Lameter <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Trond Myklebust <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Trond Myklebust <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Christoph Lameter <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control
- From: Trond Myklebust <[email protected]>
- [PATCH] nfs: fix congestion control -v3
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] nfs: fix congestion control -v3
- From: Trond Myklebust <[email protected]>
- [PATCH] nfs: fix congestion control -v4
- From: Peter Zijlstra <[email protected]>
- [RFC 0/8] Cpuset aware writeback
- Prev by Date: Re: [PATCH 2.6.20-rc5 1/1] MM: enhance Linux swap subsystem
- Next by Date: Re: [PATCH] nfs: fix congestion control -v4
- Previous by thread: [PATCH] nfs: fix congestion control -v4
- Next by thread: Re: [PATCH] nfs: fix congestion control -v4
- Index(es):