public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: "Peter T. Breuer" <ptb@it.uc3m.es>
Cc: linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: plugging in 2.4. Does it work?
Date: Tue, 20 Feb 2001 23:58:13 +0100	[thread overview]
Message-ID: <20010220235813.B811@suse.de> (raw)
In-Reply-To: <200102202241.f1KMftG31691@oboe.it.uc3m.es>
In-Reply-To: <200102202241.f1KMftG31691@oboe.it.uc3m.es>; from ptb@it.uc3m.es on Tue, Feb 20, 2001 at 11:41:55PM +0100

On Tue, Feb 20 2001, Peter T. Breuer wrote:
>  int my_end_request(struct request *req) {
>    unsigned long flags; int dequeue = 0;
>    spin_lock_irqsave(&io_request_lock, flags);
>    if (!req->errors) {
>      while (req->nr_sectors > 0) {
>        printk( KERN_DEBUG "running end_first on req with %d sectors\n",
>               req->nr_sectors);
>        if (!end_that_request_first (req, !req->errors, DEVICE_NAME))
>          break;
>      }
>    }
>    printk( KERN_DEBUG "running end_first on req with %d sectors\n",
>             req->nr_sectors);
>    if (!end_that_request_first (req, !req->errors, DEVICE_NAME)) {
>      printk( KERN_DEBUG "running end_last on req with %d sectors\n",
>               req->nr_sectors);
>      end_that_request_last(req);
>      dequeue = 1;
>    }
>    spin_unlock_irqrestore(&io_request_lock, flags);
>    return dequeue;
>  }

Forgot to mention that the above doesn't make much sense at all. If
there are no errors, you loop through ending all the buffers. Then
you fall through and end the the first (non-existant) chunk? And
end_that_request_first does not need to hold the io_request_lock,
you can move that down to protect end_that_request_last.

-- 
Jens Axboe


  parent reply	other threads:[~2001-02-20 22:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-20 22:41 plugging in 2.4. Does it work? Peter T. Breuer
2001-02-20 22:54 ` Jens Axboe
2001-02-20 23:27   ` Peter T. Breuer
2001-02-20 23:37     ` Jens Axboe
2001-02-20 23:48       ` Peter T. Breuer
2001-02-20 23:52         ` Jens Axboe
2001-02-20 22:58 ` Jens Axboe [this message]
2001-02-20 23:32   ` Peter T. Breuer
  -- strict thread matches above, loose matches on Subject: below --
2001-02-21 15:36 Peter T. Breuer
2001-02-21 17:27 ` Jens Axboe
2001-02-21 17:54   ` Peter T. Breuer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010220235813.B811@suse.de \
    --to=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptb@it.uc3m.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox