[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080315124952.GC4669@ucw.cz>
Date: Sat, 15 Mar 2008 13:49:52 +0100
From: Pavel Machek <pavel@....cz>
To: Alan Cox <alan@...rguk.ukuu.org.uk>, linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org, Jens Axboe <jens.axboe@...cle.com>
Subject: Re: [PATCH 4/4] disk-protect: Add a generic block layer queue freezing facility
On Fri 2008-03-07 19:26:41, Elias Oltmanns wrote:
> This patch provides a generic way to freeze the request queue of a block
> device temporarily. This functionality is exposed to user space via sysfs.
>
> Signed-off-by: Elias Oltmanns <eo@...ensachen.de>
I guess this should have patch going to documentation. Otherwise it
looks ok.
> +/*
> + * When reading the 'protect' attribute, we return seconds remaining
> + * before the unfreeze timeout expires.
> + */
> +static ssize_t queue_protect_show(struct request_queue *q, char *page)
> +{
> + unsigned int seconds = 0;
> +
> + if (blk_queue_stopped(q) && timer_pending(&q->unfreeze_timer))
> + /*
> + * Adding 1 in order to guarantee nonzero value until timer
> + * has actually expired.
> + */
> + seconds = jiffies_to_msecs(q->unfreeze_timer.expires
> + - jiffies) / 1000 + 1;
Is it okay to read expires without locking?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists