FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-03-2011, 02:42 PM
Mikulas Patocka
 
Default The return code from the various wait functions is never acted upon. So change to uninterrupible waits and change the return type to void.

Ack.

Mikulas

On Tue, 2 Aug 2011, Joe Thornber wrote:

> ---
> drivers/md/persistent-data/dm-block-manager.c | 23 +++++++----------------
> 1 files changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c
> index 4e2f240..c9fb132 100644
> --- a/drivers/md/persistent-data/dm-block-manager.c
> +++ b/drivers/md/persistent-data/dm-block-manager.c
> @@ -371,46 +371,37 @@ static void __clear_errors(struct dm_block_manager *bm)
>
> #define __wait_block(wq, lock, flags, sched_fn, condition)
> do {
> - int r = 0;
> -
> DEFINE_WAIT(wait);
> add_wait_queue(wq, &wait);
>
> for (; {
> - prepare_to_wait(wq, &wait, TASK_INTERRUPTIBLE);
> + prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
> if (condition)
> break;
>
> spin_unlock_irqrestore(lock, flags);
> - if (signal_pending(current)) {
> - r = -ERESTARTSYS;
> - spin_lock_irqsave(lock, flags);
> - break;
> - }
> -
> sched_fn();
> spin_lock_irqsave(lock, flags);
> }
>
> finish_wait(wq, &wait);
> - return r;
> } while (0)
>
> -static int __wait_io(struct dm_block *b, unsigned long *flags)
> +static void __wait_io(struct dm_block *b, unsigned long *flags)
> __retains(&b->bm->lock)
> {
> __wait_block(&b->io_q, &b->bm->lock, *flags, io_schedule,
> ((b->state != BS_READING) && (b->state != BS_WRITING)));
> }
>
> -static int __wait_unlocked(struct dm_block *b, unsigned long *flags)
> +static void __wait_unlocked(struct dm_block *b, unsigned long *flags)
> __retains(&b->bm->lock)
> {
> __wait_block(&b->io_q, &b->bm->lock, *flags, schedule,
> ((b->state == BS_CLEAN) || (b->state == BS_DIRTY)));
> }
>
> -static int __wait_read_lockable(struct dm_block *b, unsigned long *flags)
> +static void __wait_read_lockable(struct dm_block *b, unsigned long *flags)
> __retains(&b->bm->lock)
> {
> __wait_block(&b->io_q, &b->bm->lock, *flags, schedule,
> @@ -419,21 +410,21 @@ static int __wait_read_lockable(struct dm_block *b, unsigned long *flags)
> b->state == BS_READ_LOCKED)));
> }
>
> -static int __wait_all_writes(struct dm_block_manager *bm, unsigned long *flags)
> +static void __wait_all_writes(struct dm_block_manager *bm, unsigned long *flags)
> __retains(&bm->lock)
> {
> __wait_block(&bm->io_q, &bm->lock, *flags, io_schedule,
> !bm->writing_count);
> }
>
> -static int __wait_all_io(struct dm_block_manager *bm, unsigned long *flags)
> +static void __wait_all_io(struct dm_block_manager *bm, unsigned long *flags)
> __retains(&bm->lock)
> {
> __wait_block(&bm->io_q, &bm->lock, *flags, io_schedule,
> !bm->writing_count && !bm->reading_count);
> }
>
> -static int __wait_clean(struct dm_block_manager *bm, unsigned long *flags)
> +static void __wait_clean(struct dm_block_manager *bm, unsigned long *flags)
> __retains(&bm->lock)
> {
> __wait_block(&bm->io_q, &bm->lock, *flags, io_schedule,
> --
> 1.7.4.1
>

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 12:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org