1. 07 1月, 2009 30 次提交
  2. 06 1月, 2009 10 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm · 238c6d54
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
        dm snapshot: extend exception store functions
        dm snapshot: split out exception store implementations
        dm snapshot: rename struct exception_store
        dm snapshot: separate out exception store interface
        dm mpath: move trigger_event to system workqueue
        dm: add name and uuid to sysfs
        dm table: rework reference counting
        dm: support barriers on simple devices
        dm request: extend target interface
        dm request: add caches
        dm ioctl: allow dm_copy_name_and_uuid to return only one field
        dm log: ensure log bitmap fits on log device
        dm log: move region_size validation
        dm log: avoid reinitialising io_req on every operation
        dm: consolidate target deregistration error handling
        dm raid1: fix error count
        dm log: fix dm_io_client leak on error paths
        dm snapshot: change yield to msleep
        dm table: drop reference at unbind
      238c6d54
    • J
      dm snapshot: extend exception store functions · a159c1ac
      Jonathan Brassow 提交于
      Supply dm_add_exception as a callback to the read_metadata function.
      Add a status function ready for a later patch and name the functions
      consistently.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      a159c1ac
    • A
      dm snapshot: split out exception store implementations · 4db6bfe0
      Alasdair G Kergon 提交于
      Move the existing snapshot exception store implementations out into
      separate files.  Later patches will place these behind a new
      interface in preparation for alternative implementations.
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      4db6bfe0
    • J
      dm snapshot: rename struct exception_store · 1ae25f9c
      Jonathan Brassow 提交于
      Rename struct exception_store to dm_exception_store.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      1ae25f9c
    • J
      dm snapshot: separate out exception store interface · aea53d92
      Jonathan Brassow 提交于
      Pull structures that bridge the gap between snapshot and
      exception store out of dm-snap.h and put them in a new
      .h file - dm-exception-store.h.  This file will define the
      API for new exception stores.
      
      Ultimately, dm-snap.h is unnecessary, since only dm-snap.c
      should be using it.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      aea53d92
    • A
      dm mpath: move trigger_event to system workqueue · fe9cf30e
      Alasdair G Kergon 提交于
      The same workqueue is used both for sending uevents and processing queued I/O.
      Deadlock has been reported in RHEL5 when sending a uevent was blocked waiting
      for the queued I/O to be processed.  Use scheduled_work() for the asynchronous
      uevents instead.
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      fe9cf30e
    • M
      dm: add name and uuid to sysfs · 784aae73
      Milan Broz 提交于
      Implement simple read-only sysfs entry for device-mapper block device.
      
      This patch adds a simple sysfs directory named "dm" under block device
      properties and implements
      	- name attribute (string containing mapped device name)
      	- uuid attribute (string containing UUID, or empty string if not set)
      
      The kobject is embedded in mapped_device struct, so no additional
      memory allocation is needed for initializing sysfs entry.
      
      During the processing of sysfs attribute we need to lock mapped device
      which is done by a new function dm_get_from_kobj, which returns the md
      associated with kobject and increases the usage count.
      
      Each 'show attribute' function is responsible for its own locking.
      Signed-off-by: NMilan Broz <mbroz@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      784aae73
    • M
      dm table: rework reference counting · d5816876
      Mikulas Patocka 提交于
      Rework table reference counting.
      
      The existing code uses a reference counter. When the last reference is
      dropped and the counter reaches zero, the table destructor is called.
      Table reference counters are acquired/released from upcalls from other
      kernel code (dm_any_congested, dm_merge_bvec, dm_unplug_all).
      If the reference counter reaches zero in one of the upcalls, the table
      destructor is called from almost random kernel code.
      
      This leads to various problems:
      * dm_any_congested being called under a spinlock, which calls the
        destructor, which calls some sleeping function.
      * the destructor attempting to take a lock that is already taken by the
        same process.
      * stale reference from some other kernel code keeps the table
        constructed, which keeps some devices open, even after successful
        return from "dmsetup remove". This can confuse lvm and prevent closing
        of underlying devices or reusing device minor numbers.
      
      The patch changes reference counting so that the table destructor can be
      called only at predetermined places.
      
      The table has always exactly one reference from either mapped_device->map
      or hash_cell->new_map. After this patch, this reference is not counted
      in table->holders.  A pair of dm_create_table/dm_destroy_table functions
      is used for table creation/destruction.
      
      Temporary references from the other code increase table->holders. A pair
      of dm_table_get/dm_table_put functions is used to manipulate it.
      
      When the table is about to be destroyed, we wait for table->holders to
      reach 0. Then, we call the table destructor.  We use active waiting with
      msleep(1), because the situation happens rarely (to one user in 5 years)
      and removing the device isn't performance-critical task: the user doesn't
      care if it takes one tick more or not.
      
      This way, the destructor is called only at specific points
      (dm_table_destroy function) and the above problems associated with lazy
      destruction can't happen.
      
      Finally remove the temporary protection added to dm_any_congested().
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      d5816876
    • A
      dm: support barriers on simple devices · ab4c1424
      Andi Kleen 提交于
      Implement barrier support for single device DM devices
      
      This patch implements barrier support in DM for the common case of dm linear
      just remapping a single underlying device. In this case we can safely
      pass the barrier through because there can be no reordering between
      devices.
      
       NB. Any DM device might cease to support barriers if it gets
           reconfigured so code must continue to allow for a possible
           -EOPNOTSUPP on every barrier bio submitted.  - agk
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      ab4c1424
    • K
      dm request: extend target interface · 7d76345d
      Kiyoshi Ueda 提交于
      This patch adds the following target interfaces for request-based dm.
      
        map_rq    : for mapping a request
      
        rq_end_io : for finishing a request
      
        busy      : for avoiding performance regression from bio-based dm.
                    Target can tell dm core not to map requests now, and
                    that may help requests in the block layer queue to be
                    bigger by I/O merging.
                    In bio-based dm, this behavior is done by device
                    drivers managing the block layer queue.
                    But in request-based dm, dm core has to do that
                    since dm core manages the block layer queue.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      7d76345d