1. 29 4月, 2008 4 次提交
    • H
      Remove duplicated unlikely() in IS_ERR() · 801678c5
      Hirofumi Nakagawa 提交于
      Some drivers have duplicated unlikely() macros.  IS_ERR() already has
      unlikely() in itself.
      
      This patch cleans up such pointless code.
      Signed-off-by: NHirofumi Nakagawa <hnakagawa@miraclelinux.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NJeff Garzik <jeff@garzik.org>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      801678c5
    • L
      NBD: add partition support · d71a6d73
      Laurent Vivier 提交于
      Permit the use of partitions with network block devices (NBD).
      
      A new parameter is introduced to define how many partition we want to be able
      to manage per network block device.  This parameter is "max_part".
      
      For instance, to manage 63 partitions / loop device, we will do:
      
         [on the server side]
      # nbd-server 1234 /dev/sdb
         [on the client side]
      # modprobe nbd max_part=63
      # ls -l /dev/nbd*
      brw-rw---- 1 root disk 43,   0 2008-03-25 11:14 /dev/nbd0
      brw-rw---- 1 root disk 43,  64 2008-03-25 11:11 /dev/nbd1
      brw-rw---- 1 root disk 43, 640 2008-03-25 11:11 /dev/nbd10
      brw-rw---- 1 root disk 43, 704 2008-03-25 11:11 /dev/nbd11
      brw-rw---- 1 root disk 43, 768 2008-03-25 11:11 /dev/nbd12
      brw-rw---- 1 root disk 43, 832 2008-03-25 11:11 /dev/nbd13
      brw-rw---- 1 root disk 43, 896 2008-03-25 11:11 /dev/nbd14
      brw-rw---- 1 root disk 43, 960 2008-03-25 11:11 /dev/nbd15
      brw-rw---- 1 root disk 43, 128 2008-03-25 11:11 /dev/nbd2
      brw-rw---- 1 root disk 43, 192 2008-03-25 11:11 /dev/nbd3
      brw-rw---- 1 root disk 43, 256 2008-03-25 11:11 /dev/nbd4
      brw-rw---- 1 root disk 43, 320 2008-03-25 11:11 /dev/nbd5
      brw-rw---- 1 root disk 43, 384 2008-03-25 11:11 /dev/nbd6
      brw-rw---- 1 root disk 43, 448 2008-03-25 11:11 /dev/nbd7
      brw-rw---- 1 root disk 43, 512 2008-03-25 11:11 /dev/nbd8
      brw-rw---- 1 root disk 43, 576 2008-03-25 11:11 /dev/nbd9
      # nbd-client localhost 1234 /dev/nbd0
      Negotiation: ..size = 80418240KB
      bs=1024, sz=80418240
      
      -------NOTE, RFC: partition table is not automatically read.
      The driver sets bdev->bd_invalidated to 1 to force the read of the partition
      table of the device, but this is done only on an open of the device.
      So we have to do a "touch /dev/nbdX" or something like that.
      It can't be done from the nbd-client or nbd driver because at this
      level we can't ask to read the partition table and to serve the request
      at the same time (-> deadlock)
      
      If someone has a better idea, I'm open to any suggestion.
      -------NOTE, RFC
      
      # fdisk -l /dev/nbd0
      
      Disk /dev/nbd0: 82.3 GB, 82348277760 bytes
      255 heads, 63 sectors/track, 10011 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      
           Device Boot      Start         End      Blocks   Id  System
      /dev/nbd0p1   *           1        9965    80043831   83  Linux
      /dev/nbd0p2            9966       10011      369495    5  Extended
      /dev/nbd0p5            9966       10011      369463+  82  Linux swap / Solaris
      
      # ls -l /dev/nbd0*
      brw-rw---- 1 root disk 43,   0 2008-03-25 11:16 /dev/nbd0
      brw-rw---- 1 root disk 43,   1 2008-03-25 11:16 /dev/nbd0p1
      brw-rw---- 1 root disk 43,   2 2008-03-25 11:16 /dev/nbd0p2
      brw-rw---- 1 root disk 43,   5 2008-03-25 11:16 /dev/nbd0p5
      # mount /dev/nbd0p1 /mnt
      # ls /mnt
      bin    dev   initrd      lost+found  opt   sbin     sys  var
      boot   etc   initrd.img  media       proc  selinux  tmp  vmlinuz
      cdrom  home  lib         mnt         root  srv      usr
      # umount /mnt
      # nbd-client -d /dev/nbd0
      # ls -l /dev/nbd0*
      brw-rw---- 1 root disk 43, 0 2008-03-25 11:16 /dev/nbd0
      -------NOTE
      On "nbd-client -d", we can do an iocl(BLKRRPART) to update partition table:
      as the size of the device is 0, we don't have to serve the partition manager
      request (-> no deadlock).
      -------NOTE
      Signed-off-by: NPaul Clements <paul.clements@steeleye.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d71a6d73
    • L
      NBD: allow nbd to be used locally · 48cf6061
      Laurent Vivier 提交于
      This patch allows Network Block Device to be mounted locally (nbd-client to
      nbd-server over 127.0.0.1).
      
      It creates a kthread to avoid the deadlock described in NBD tools
      documentation.  So, if nbd-client hangs waiting for pages, the kblockd thread
      can continue its work and free pages.
      
      I have tested the patch to verify that it avoids the hang that always occurs
      when writing to a localhost nbd connection.  I have also tested to verify that
      no performance degradation results from the additional thread and queue.
      
      Patch originally from Laurent Vivier.
      Signed-off-by: NPaul Clements <paul.clements@steeleye.com>
      Signed-off-by: NLaurent Vivier <Laurent.Vivier@bull.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      48cf6061
    • F
      block: use blk_rq_init() to initialize the request · 4f54eec8
      FUJITA Tomonori 提交于
      Any path needs to call it to initialize the request.
      
      This is a preparation for large command support, which needs to
      initialize the request in a proper way (that is, just doing a memset()
      will not work).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      4f54eec8
  2. 03 4月, 2008 1 次提交
  3. 24 2月, 2008 1 次提交
  4. 09 2月, 2008 1 次提交
  5. 28 1月, 2008 1 次提交
  6. 25 1月, 2008 1 次提交
    • K
      Driver core: convert block from raw kobjects to core devices · edfaa7c3
      Kay Sievers 提交于
      This moves the block devices to /sys/class/block. It will create a
      flat list of all block devices, with the disks and partitions in one
      directory. For compatibility /sys/block is created and contains symlinks
      to the disks.
      
        /sys/class/block
        |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
        |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
        |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
        |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
        |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
        |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
        |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
        `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      
        /sys/block/
        |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      edfaa7c3
  7. 13 11月, 2007 1 次提交
  8. 20 10月, 2007 2 次提交
  9. 17 10月, 2007 4 次提交
  10. 10 10月, 2007 2 次提交
  11. 24 7月, 2007 1 次提交
  12. 17 7月, 2007 1 次提交
  13. 10 7月, 2007 1 次提交
    • B
      [PATCH] fix request->cmd == INT cases · e654bc43
      Boaz Harrosh 提交于
       - I have unearthed very old bugs in stale drivers that still
         used request->cmd as a READ|WRITE int
       - This patch is maybe a proof that these drivers have not been
         used for a long time. Should they be removed completely?
      
      Drivers that currently do not work for sure:
       drivers/acorn/block/fd1772.c |    2 +-
       drivers/acorn/block/mfmhd.c  |    8 ++++----
       drivers/cdrom/aztcd.c        |    2 +-
       drivers/cdrom/cm206.c        |    2 +-
       drivers/cdrom/gscd.c         |    2 +-
       drivers/cdrom/mcdx.c         |    2 +-
       drivers/cdrom/optcd.c        |    2 +-
       drivers/cdrom/sjcd.c         |    2 +-
      
      Drivers with cosmetic fixes only:
        b/drivers/block/amiflop.c
        b/drivers/block/nbd.c
        b/drivers/ide/legacy/hd.c
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e654bc43
  14. 10 5月, 2007 1 次提交
  15. 09 12月, 2006 1 次提交
  16. 08 12月, 2006 1 次提交
  17. 01 10月, 2006 1 次提交
    • J
      [PATCH] Split struct request ->flags into two parts · 4aff5e23
      Jens Axboe 提交于
      Right now ->flags is a bit of a mess: some are request types, and
      others are just modifiers. Clean this up by splitting it into
      ->cmd_type and ->cmd_flags. This allows introduction of generic
      Linux block message types, useful for sending generic Linux commands
      to block devices.
      Signed-off-by: NJens Axboe <axboe@suse.de>
      4aff5e23
  18. 01 8月, 2006 2 次提交
  19. 02 7月, 2006 1 次提交
  20. 27 6月, 2006 4 次提交
  21. 26 6月, 2006 1 次提交
  22. 26 3月, 2006 1 次提交
  23. 23 3月, 2006 1 次提交
  24. 09 1月, 2006 1 次提交
  25. 07 1月, 2006 1 次提交
    • H
      [PATCH] nbd: fix TX/RX race condition · 4b2f0260
      Herbert Xu 提交于
      Janos Haar of First NetCenter Bt.  reported numerous crashes involving the
      NBD driver.  With his help, this was tracked down to bogus bio vectors
      which in turn was the result of a race condition between the
      receive/transmit routines in the NBD driver.
      
      The bug manifests itself like this:
      
      CPU0				CPU1
      do_nbd_request
      	add req to queuelist
      	nbd_send_request
      		send req head
      		for each bio
      			kmap
      			send
      				nbd_read_stat
      					nbd_find_request
      					nbd_end_request
      			kunmap
      
      When CPU1 finishes nbd_end_request, the request and all its associated
      bio's are freed.  So when CPU0 calls kunmap whose argument is derived from
      the last bio, it may crash.
      
      Under normal circumstances, the race occurs only on the last bio.  However,
      if an error is encountered on the remote NBD server (such as an incorrect
      magic number in the request), or if there were a bug in the server, it is
      possible for the nbd_end_request to occur any time after the request's
      addition to the queuelist.
      
      The following patch fixes this problem by making sure that requests are not
      added to the queuelist until after they have been completed transmission.
      
      In order for the receiving side to be ready for responses involving
      requests still being transmitted, the patch introduces the concept of the
      active request.
      
      When a response matches the current active request, its processing is
      delayed until after the tranmission has come to a stop.
      
      This has been tested by Janos and it has been successful in curing this
      race condition.
      
      From: Herbert Xu <herbert@gondor.apana.org.au>
      
        Here is an updated patch which removes the active_req wait in
        nbd_clear_queue and the associated memory barrier.
      
        I've also clarified this in the comment.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Cc: <djani22@dynamicweb.hu>
      Cc: Paul Clements <Paul.Clements@SteelEye.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4b2f0260
  26. 06 1月, 2006 1 次提交
    • T
      [BLOCK] add @uptodate to end_that_request_last() and @error to rq_end_io_fn() · 8ffdc655
      Tejun Heo 提交于
      add @uptodate argument to end_that_request_last() and @error
      to rq_end_io_fn().  there's no generic way to pass error code
      to request completion function, making generic error handling
      of non-fs request difficult (rq->errors is driver-specific and
      each driver uses it differently).  this patch adds @uptodate
      to end_that_request_last() and @error to rq_end_io_fn().
      
      for fs requests, this doesn't really matter, so just using the
      same uptodate argument used in the last call to
      end_that_request_first() should suffice.  imho, this can also
      help the generic command-carrying request jens is working on.
      Signed-off-by: Ntejun heo <htejun@gmail.com>
      Signed-Off-By: NJens Axboe <axboe@suse.de>
      8ffdc655
  27. 01 5月, 2005 1 次提交
  28. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4