1. 12 Aug, 2010 24 commits
    • Mike Snitzer's avatar
      dm: factor out max_io_len_target_boundary · 56a67df7
      Mike Snitzer authored
      Split max_io_len_target_boundary out of max_io_len so that the discard
      support can make use of it without duplicating max_io_len code.
      
      Avoiding max_io_len's split_io logic enables DM's discard support to
      submit the entire discard request to a target.  But discards must still
      be split on target boundaries.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      56a67df7
    • Mike Snitzer's avatar
      dm: use common __issue_target_request for flush and discard support · 06a426ce
      Mike Snitzer authored
      Rename __flush_target to __issue_target_request now that it is used to
      issue both flush and discard requests.
      
      Introduce __issue_target_requests as a convenient wrapper to
      __issue_target_request 'num_flush_requests' or 'num_discard_requests'
      times per target.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      06a426ce
    • Mike Snitzer's avatar
      dm: linear support discard · 5ae89a87
      Mike Snitzer authored
      Allow discards to be passed through to linear mappings if at least one
      underlying device supports it.  Discards will be forwarded only to
      devices that support them.
      
      A target that supports discards should set num_discard_requests to
      indicate how many times each discard request must be submitted to it.
      
      Verify table's underlying devices support discards prior to setting the
      associated DM device as capable of discards (via QUEUE_FLAG_DISCARD).
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: default avatarJoe Thornber <thornber@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      5ae89a87
    • Milan Broz's avatar
      dm crypt: simplify crypt_ctr · 5ebaee6d
      Milan Broz authored
      Allocate cipher strings indpendently of struct crypt_config and move
      cipher parsing and allocation into a separate function to prepare for
      supporting the cryptoapi format e.g. "xts(aes)".
      
      No functional change in this patch.
      Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      5ebaee6d
    • Milan Broz's avatar
      dm crypt: simplify crypt_config destruction logic · 28513fcc
      Milan Broz authored
      Use just one label and reuse common destructor for crypt target.
      
      Parse remaining argv arguments in logic order.
      
      Also do not ignore error values from IV init and set key functions.
      
      No functional change in this patch except changed return codes
      based on above.
      Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      28513fcc
    • Peter Rajnoha's avatar
      dm: allow autoloading of dm mod · 7e507eb6
      Peter Rajnoha authored
      Add devname:mapper/control and MAPPER_CTRL_MINOR module alias
      to support dm-mod module autoloading.
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      7e507eb6
    • Mike Snitzer's avatar
      dm: rename map_info flush_request to target_request_nr · 57cba5d3
      Mike Snitzer authored
      'target_request_nr' is a more generic name that reflects the fact that
      it will be used for both flush and discard support.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      57cba5d3
    • Will Drewry's avatar
      dm ioctl: refactor dm_table_complete · 26803b9f
      Will Drewry authored
      This change unifies the various checks and finalization that occurs on a
      table prior to use.  By doing so, it allows table construction without
      traversing the dm-ioctl interface.
      Signed-off-by: default avatarWill Drewry <wad@chromium.org>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      26803b9f
    • Mikulas Patocka's avatar
      dm snapshot: implement merge · b1d55528
      Mikulas Patocka authored
      Implement merge method for the snapshot origin to improve read
      performance.
      
      Without merge method, dm asks the upper layers to submit smallest possible
      bios --- one page. Submitting such small bios impacts performance negatively
      when reading or writing the origin device.
      
      Without this patch, CPU consumption when reading the origin on lvm on md-raid0
      was 6 to 12%, with this patch, it drops to 1 to 4%.
      
      Note: in my testing, it actually degraded performance in some settings, I
      traced it to Maxtor disks having problems with > 512-sector requests.
      Reducing the number of sectors to /sys/block/sd*/queue/max_sectors_kb to
      256 fixed the read performance. I think we don't have to care about weird
      disks that actually degrade performance because of large requests being
      sent to them.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      b1d55528
    • Mike Snitzer's avatar
      dm: do not initialise full request queue when bio based · 4a0b4ddf
      Mike Snitzer authored
      Change bio-based mapped devices no longer to have a fully initialized
      request_queue (request_fn, elevator, etc).  This means bio-based DM
      devices no longer register elevator sysfs attributes ('iosched/' tree
      or 'scheduler' other than "none").
      
      In contrast, a request-based DM device will continue to have a full
      request_queue and will register elevator sysfs attributes.  Therefore
      a user can determine a DM device's type by checking if elevator sysfs
      attributes exist.
      
      First allocate a minimalist request_queue structure for a DM device
      (needed for both bio and request-based DM).
      
      Initialization of a full request_queue is deferred until it is known
      that the DM device is request-based, at the end of the table load
      sequence.
      
      Factor DM device's request_queue initialization:
      - common to both request-based and bio-based into dm_init_md_queue().
      - specific to request-based into dm_init_request_based_queue().
      
      The md->type_lock mutex is used to protect md->queue, in addition to
      md->type, during table_load().
      
      A DM device's first table_load will establish the immutable md->type.
      But md->queue initialization, based on md->type, may fail at that time
      (because blk_init_allocated_queue cannot allocate memory).  Therefore
      any subsequent table_load must (re)try dm_setup_md_queue independently of
      establishing md->type.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Acked-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      4a0b4ddf
    • Mike Snitzer's avatar
      dm ioctl: make bio or request based device type immutable · a5664dad
      Mike Snitzer authored
      Determine whether a mapped device is bio-based or request-based when
      loading its first (inactive) table and don't allow that to be changed
      later.
      
      This patch performs different device initialisation in each of the two
      cases.  (We don't think it's necessary to add code to support changing
      between the two types.)
      
      Allowed md->type transitions:
        DM_TYPE_NONE to DM_TYPE_BIO_BASED
        DM_TYPE_NONE to DM_TYPE_REQUEST_BASED
      
      We now prevent table_load from replacing the inactive table with a
      conflicting type of table even after an explicit table_clear.
      
      Introduce 'type_lock' into the struct mapped_device to protect md->type
      and to prepare for the next patch that will change the queue
      initialization and allocate memory while md->type_lock is held.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Acked-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      
       drivers/md/dm-ioctl.c    |   15 +++++++++++++++
       drivers/md/dm.c          |   37 ++++++++++++++++++++++++++++++-------
       drivers/md/dm.h          |    5 +++++
       include/linux/dm-ioctl.h |    4 ++--
       4 files changed, 52 insertions(+), 9 deletions(-)
      a5664dad
    • Mikulas Patocka's avatar
      dm: skip second flush on bio unsupported error · 708e9295
      Mikulas Patocka authored
      When processing barriers, skip the second flush if processing the bio
      failed with -EOPNOTSUPP.  This can happen with discard+barrier requests.
      If the device doesn't support discard, there would be two useless
      SYNCHRONIZE CACHE commands.  The first dm_flush cannot be so easily
      optimized out, so we leave it there.
      
      Previously, -EOPNOTSUPP could be received in dec_pending only with empty
      barriers and we ignored that error, assuming the device not supporting
      cache flushes has cache always consistent.  With the addition of discard
      barriers, this -EOPNOTSUPP can also be generated by discards and we
      must record it in md->barrier_error for process_barrier.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      708e9295
    • Tomohiro Kusumi's avatar
      dm snapshot: persistent use define for disk header chunk size · 87c961cb
      Tomohiro Kusumi authored
      This patch fixes hard-coded value for the size of a chunk that includes
      disk header for persistent snapshot. It should be changed to existing
      macro NUM_SNAPSHOT_HDR_CHUNKS instead of using hard-coded value 1.
      Signed-off-by: default avatarTomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      87c961cb
    • Julia Lawall's avatar
      dm crypt: use kstrdup · a9c88f2e
      Julia Lawall authored
      Use kstrdup when the goal of an allocation is copy a string into the
      allocated region.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression from,to;
      expression flag,E1,E2;
      statement S;
      @@
      
      -  to = kmalloc(strlen(from) + 1,flag);
      +  to = kstrdup(from, flag);
         ... when != \(from = E1 \| to = E1 \)
         if (to==NULL || ...) S
         ... when != \(from = E2 \| to = E2 \)
      -  strcpy(to, from);
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      a9c88f2e
    • Arnd Bergmann's avatar
      dm ioctl: use nonseekable_open · 402ab352
      Arnd Bergmann authored
      The dm control device does not implement read/write, so it has no use for
      seeking.  Using no_llseek prevents falling back to default_llseek, which
      requires the BKL.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      402ab352
    • Kiyoshi Ueda's avatar
      dm: separate device deletion from dm_put · 3f77316d
      Kiyoshi Ueda authored
      This patch separates the device deletion code from dm_put()
      to make sure the deletion happens in the process context.
      
      By this patch, device deletion always occurs in an ioctl (process)
      context and dm_put() can be called in interrupt context.
      As a result, the request-based dm's bad dm_put() usage pointed out
      by Mikulas below disappears.
          http://marc.info/?l=dm-devel&m=126699981019735&w=2
      
      Without this patch, I confirmed there is a case to crash the system:
          dm_put() => dm_table_destroy() => vfree() => BUG_ON(in_interrupt())
      
      Some more backgrounds and details:
      In request-based dm, a device opener can remove a mapped_device
      while the last request is still completing, because bios in the last
      request complete first and then the device opener can close and remove
      the mapped_device before the last request completes:
        CPU0                                          CPU1
        =================================================================
        <<INTERRUPT>>
        blk_end_request_all(clone_rq)
          blk_update_request(clone_rq)
            bio_endio(clone_bio) == end_clone_bio
              blk_update_request(orig_rq)
                bio_endio(orig_bio)
                                                      <<I/O completed>>
                                                      dm_blk_close()
                                                      dev_remove()
                                                        dm_put(md)
                                                          <<Free md>>
         blk_finish_request(clone_rq)
           ....
           dm_end_request(clone_rq)
             free_rq_clone(clone_rq)
             blk_end_request_all(orig_rq)
             rq_completed(md)
      
      So request-based dm used dm_get()/dm_put() to hold md for each I/O
      until its request completion handling is fully done.
      However, the final dm_put() can call the device deletion code which
      must not be run in interrupt context and may cause kernel panic.
      
      To solve the problem, this patch moves the device deletion code,
      dm_destroy(), to predetermined places that is actually deleting
      the mapped_device in ioctl (process) context, and changes dm_put()
      just to decrement the reference count of the mapped_device.
      By this change, dm_put() can be used in any context and the symmetric
      model below is introduced:
          dm_create():  create a mapped_device
          dm_destroy(): destroy a mapped_device
          dm_get():     increment the reference count of a mapped_device
          dm_put():     decrement the reference count of a mapped_device
      
      dm_destroy() waits for all references of the mapped_device to disappear,
      then deletes the mapped_device.
      
      dm_destroy() uses active waiting with msleep(1), since deleting
      the mapped_device isn't performance-critical task.
      And since at this point, nobody opens the mapped_device and no new
      reference will be taken, the pending counts are just for racing
      completing activity and will eventually decrease to zero.
      
      For the unlikely case of the forced module unload, dm_destroy_immediate(),
      which doesn't wait and forcibly deletes the mapped_device, is also
      introduced and used in dm_hash_remove_all().  Otherwise, "rmmod -f"
      may be stuck and never return.
      And now, because the mapped_device is deleted at this point, subsequent
      accesses to the mapped_device may cause NULL pointer references.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      3f77316d
    • Kiyoshi Ueda's avatar
      dm ioctl: release _hash_lock between devices in remove_all · 98f33285
      Kiyoshi Ueda authored
      This patch changes dm_hash_remove_all() to release _hash_lock when
      removing a device.  After removing the device, dm_hash_remove_all()
      takes _hash_lock and searches the hash from scratch again.
      
      This patch is a preparation for the next patch, which changes device
      deletion code to wait for md reference to be 0.  Without this patch,
      the wait in the next patch may cause AB-BA deadlock:
        CPU0                                CPU1
        -----------------------------------------------------------------------
        dm_hash_remove_all()
          down_write(_hash_lock)
                                            table_status()
                                              md = find_device()
                                                     dm_get(md)
                                                       <increment md->holders>
                                              dm_get_live_or_inactive_table()
                                                dm_get_inactive_table()
                                                  down_write(_hash_lock)
          <in the md deletion code>
            <wait for md->holders to be 0>
      Signed-off-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      98f33285
    • Kiyoshi Ueda's avatar
      dm: prevent access to md being deleted · abdc568b
      Kiyoshi Ueda authored
      This patch prevents access to mapped_device which is being deleted.
      
      Currently, even after a mapped_device has been removed from the hash,
      it could be accessed through idr_find() using minor number.
      That could cause a race and NULL pointer reference below:
        CPU0                          CPU1
        ------------------------------------------------------------------
        dev_remove(param)
          down_write(_hash_lock)
          dm_lock_for_deletion(md)
            spin_lock(_minor_lock)
            set_bit(DMF_DELETING)
            spin_unlock(_minor_lock)
          __hash_remove(hc)
          up_write(_hash_lock)
                                      dev_status(param)
                                        md = find_device(param)
                                               down_read(_hash_lock)
                                               __find_device_hash_cell(param)
                                                 dm_get_md(param->dev)
                                                   md = dm_find_md(dev)
                                                          spin_lock(_minor_lock)
                                                          md = idr_find(MINOR(dev))
                                                          spin_unlock(_minor_lock)
          dm_put(md)
            free_dev(md)
                                                   dm_get(md)
                                               up_read(_hash_lock)
                                        __dev_status(md, param)
                                        dm_put(md)
      
      This patch fixes such problems.
      Signed-off-by: default avatarKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      abdc568b
    • Peter Rajnoha's avatar
      dm ioctl: return uevent flag after rename · 856a6f1d
      Peter Rajnoha authored
      All the dm ioctls that generate uevents set the DM_UEVENT_GENERATED flag so
      that userspace knows whether or not to wait for a uevent to be processed
      before continuing,
      
      The dm rename ioctl sets this flag but was not structured to return it
      to userspace.  This patch restructures the rename ioctl processing to
      behave like the other ioctls that return data and so fix this.
      Signed-off-by: default avatarPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      856a6f1d
    • Alasdair G Kergon's avatar
      dm ioctl: make __dev_status void · 094ea9a0
      Alasdair G Kergon authored
      __dev_status() cannot fail so make it void and simplify callers.
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      094ea9a0
    • Peter Rajnoha's avatar
      dm ioctl: remove __dev_status from geometry and target message · 6be54494
      Peter Rajnoha authored
      Remove useless __dev_status call while processing an ioctl that sets up
      device geometry and target message.  The data is not returned to
      userspace so there is no point collecting it and in the case of
      target_message it is collected before processing the message so if it
      did return it might be stale.
      Signed-off-by: default avatarPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      6be54494
    • Mikulas Patocka's avatar
      dm snapshot: test chunk size against both origin and snapshot · c2411045
      Mikulas Patocka authored
      Validate chunk size against both origin and snapshot sector size
      
      Don't allow chunk size smaller than either origin or snapshot logical
      sector size. Reading or writing data not aligned to sector size is not
      allowed and causes immediate errors.
      
      This requires us to open the origin before initialising the
      exception store and to export dm_snap_origin.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      c2411045
    • Mikulas Patocka's avatar
      dm snapshot: iterate origin and cow devices · 1e5554c8
      Mikulas Patocka authored
      Iterate both origin and snapshot devices
      
      iterate_devices method should call the callback for all the devices where
      the bio may be remapped. Thus, snapshot_iterate_devices should call the callback
      for both snapshot and origin underlying devices because it remaps some bios
      to the snapshot and some to the origin.
      
      snapshot_iterate_devices called the callback only for the origin device.
      This led to badly calculated device limits if snapshot and origin were placed
      on different types of disks.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      1e5554c8
    • Alasdair G Kergon's avatar
      dm mpath: fix NULL pointer dereference when path parameters missing · 6bbf79a1
      Alasdair G Kergon authored
      multipath_ctr() forgets to return an error after detecting
      missing path parameters.  Fix this.
      Signed-off-by: default avatarPatrick LoPresti <lopresti@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      6bbf79a1
  2. 11 Aug, 2010 16 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 · 5af568cb
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
        isofs: Fix lseek() to position beyond 4 GB
        vfs: remove unused MNT_STRICTATIME
        vfs: show unreachable paths in getcwd and proc
        vfs: only add " (deleted)" where necessary
        vfs: add prepend_path() helper
        vfs: __d_path: dont prepend the name of the root dentry
        ia64: perfmon: add d_dname method
        vfs: add helpers to get root and pwd
        cachefiles: use path_get instead of lone dget
        fs/sysv/super.c: add support for non-PDP11 v7 filesystems
        V7: Adjust sanity checks for some volumes
        Add v7 alias
        v9fs: fixup for inode_setattr being removed
      
      Manual merge to take Al's version of the fs/sysv/super.c file: it merged
      cleanly, but Al had removed an unnecessary header include, so his side
      was better.
      5af568cb
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus · 062e27ec
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
        Squashfs: fix checkpatch.pl warnings
        Squashfs: fix filename typo
        Squashfs: update Kconfig and documentation for LZO
        Squashfs: fix block size use in LZO decompressor
        Squashfs: Add LZO compression support
        squashfs: fix filename in header comment
        Squashfs: Make XATTR config name consistent with other file systems
        squashfs: fix compiler inline warning
      062e27ec
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd · bf25db36
      Linus Torvalds authored
      * 'for-linus' of git://git.open-osd.org/linux-open-osd:
        exofs: Fix groups code when num_devices is not divisible by group_width
        exofs: Remove useless optimization
        exofs: exofs_file_fsync and exofs_file_flush correctness
        exofs: Remove superfluous dependency on buffer_head and writeback
      bf25db36
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 682c30ed
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (39 commits)
        ceph: generalize mon requests, add pool op support
        ceph: only queue async writeback on cap revocation if there is dirty data
        ceph: do not ignore osd_idle_ttl mount option
        ceph: constify dentry_operations
        ceph: whitespace cleanup
        ceph: add flock/fcntl lock support
        ceph: define on-wire types, constants for file locking support
        ceph: add CEPH_FEATURE_FLOCK to the supported feature bits
        ceph: support v2 reconnect encoding
        ceph: support v2 client_caps encoding
        ceph: move AES iv definition to shared header
        ceph: fix decoding of pool snap info
        ceph: make ->sync_fs not wait if wait==0
        ceph: warn on missing snap realm
        ceph: print useful error message when crush rule not found
        ceph: use %pU to print uuid (fsid)
        ceph: sync header defs with server code
        ceph: clean up header guards
        ceph: strip misleading/obsolete version, feature info
        ceph: specify supported features in super.h
        ...
      682c30ed
    • Linus Torvalds's avatar
      Merge branch 'msm-video' of git://codeaurora.org/quic/kernel/dwalker/linux-msm · 84479f3c
      Linus Torvalds authored
      * 'msm-video' of git://codeaurora.org/quic/kernel/dwalker/linux-msm:
        video: msm: Fix section mismatch in mddi.c.
        drivers: video: msm: drop some unused variables
      84479f3c
    • Linus Torvalds's avatar
      Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 · 946880fa
      Linus Torvalds authored
      * 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6:
        IXP4xx: Fix LL debugging on little-endian CPU.
        IXP4xx: Fix sparse warnings in I/O primitives.
        IXP4xx: Make mdio_bus struct static in the Ethernet driver.
        IXP4xx: Fix ixp4xx_crypto little-endian operation.
        IXP4xx: Prevent HSS transmitter lockup by disabling FRaMe signals.
        ixp4xx/vulcan: add PCI support
        ixp4xx: base support for Arcom Vulcan
      946880fa
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm · 636d1742
      Linus Torvalds authored
      * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (226 commits)
        ARM: 6323/1: cam60: don't use __init for cam60_spi_{flash_platform_data,partitions}
        ARM: 6324/1: cam60: move cam60_spi_devices to .init.data
        ARM: 6322/1: imx/pca100: Fix name of spi platform data
        ARM: 6321/1: fix syntax error in main Kconfig file
        ARM: 6297/1: move U300 timer to dynamic clock lookup
        ARM: 6296/1: clock U300 intcon and timer properly
        ARM: 6295/1: fix U300 apb_pclk split
        ARM: 6306/1: fix inverted MMC card detect in U300
        ARM: 6299/1: errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID
        ARM: 6294/1: etm: do a dummy read from OSSRR during initialization
        ARM: 6292/1: coresight: add ETM management registers
        ARM: 6288/1: ftrace: document mcount formats
        ARM: 6287/1: ftrace: clean up mcount assembly indentation
        ARM: 6286/1: fix Thumb-2 decompressor broken by "Auto calculate ZRELADDR"
        ARM: 6281/1: video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
        ARM: 6280/1: imx: Fix build failure when including <mach/gpio.h> without <linux/spinlock.h>
        ARM: S5PV210: Fix on missing s3c-sdhci card detection method for hsmmc3
        ARM: S5P: Fix on missing S5P_DEV_FIMC in plat-s5p/Kconfig
        ARM: S5PV210: Override FIMC driver name on Aquila board
        ARM: S5PC100: enable FIMC on SMDKC100
        ...
      
      Fix up conflicts in arch/arm/mach-{s5pc100,s5pv210}/cpu.c due to
      different subsystem 'setname' calls, and trivial port types in
      include/linux/serial_core.h
      636d1742
    • Prarit Bhargava's avatar
      lib/decompress_bunzip2.c: fix checkstack warning · dd21e9bd
      Prarit Bhargava authored
      Fix checkstack error:
      
      lib/decompress_bunzip2.c: In function `get_next_block':
      lib/decompress_bunzip2.c:511: warning: the frame size of 1932 bytes is larger than 1024 bytes
      
      byteCount, symToByte, and mtfSymbol cannot be declared static or allocated
      dynamically so place them in the bunzip_data struct.
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dd21e9bd
    • Stefani Seibold's avatar
      kfifo: add example files to the kernel sample directory · 5bf2b193
      Stefani Seibold authored
      Add four examples to the kernel sample directory.
      
      It shows how to handle:
      - a byte stream fifo
      - a integer type fifo
      - a dynamic record sized fifo
      - the fifo DMA functions
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarStefani Seibold <stefani@seibold.net>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5bf2b193
    • Stefani Seibold's avatar
      kfifo: replace the old non generic API · 2e956fb3
      Stefani Seibold authored
      Simply replace the whole kfifo.c and kfifo.h files with the new generic
      version and fix the kerneldoc API template file.
      Signed-off-by: default avatarStefani Seibold <stefani@seibold.net>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2e956fb3
    • Stefani Seibold's avatar
      kfifo: add the new generic kfifo API · 4201d9a8
      Stefani Seibold authored
      Add the new version of the kfifo API files kfifo.c and kfifo.h.
      Signed-off-by: default avatarStefani Seibold <stefani@seibold.net>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4201d9a8
    • Stefani Seibold's avatar
      kfifo: fix kfifo miss use of nozami.c · 4457d984
      Stefani Seibold authored
      There are different types of a fifo which can not handled in C without a
      lot of overhead.  So i decided to write the API as a set of macros, which
      is the only way to do a kind of template meta programming without C++.
      This macros handles the different types of fifos in a transparent way.
      
      There are a lot of benefits:
      
      - Compile time handling of the different fifo types
      - Better performance (a save put or get of an integer does only generate
        9 assembly instructions on a x86)
      - Type save
      - Cleaner interface, the additional kfifo_..._rec() functions are gone
      - Easier to use
      - Less error prone
      - Different types of fifos: it is now possible to define a int fifo or
        any other type. See below for an example.
      - Smaller footprint for none byte type fifos
      - No need of creating a second hidden variable, like in the old DEFINE_KFIFO
      
      The API was not changed.
      
      There are now real in place fifos where the data space is a part of the
      structure.  The fifo needs now 20 byte plus the fifo space.  Dynamic
      assigned or allocated create a little bit more code.
      
      Most of the macros code will be optimized away and simple generate a
      function call.  Only the really small one generates inline code.
      
      Additionally you can now create fifos for any data type, not only the
      "unsigned char" byte streamed fifos.
      
      There is also a new kfifo_put and kfifo_get function, to handle a single
      element in a fifo.  This macros generates inline code, which is lit bit
      larger but faster.
      
      I know that this kind of macros are very sophisticated and not easy to
      maintain.  But i have all tested and it works as expected.  I analyzed the
      output of the compiler and for the x86 the code is as good as hand written
      assembler code.  For the byte stream fifo the generate code is exact the
      same as with the current kfifo implementation.  For all other types of
      fifos the code is smaller before, because the interface is easier to use.
      
      The main goal was to provide an API which is very intuitive, save and easy
      to use.  So linux will get now a powerful fifo API which provides all what
      a developer needs.  This will save in the future a lot of kernel space,
      since there is no need to write an own implementation.  Most of the device
      driver developers need a fifo, and also deep kernel development will gain
      benefit from this API.
      
      Here are the results of the text section usage:
      
      Example 1:
                              kfifo_put/_get  kfifo_in/out    current kfifo
      dynamic allocated       0x000002a8      0x00000291      0x00000299
      in place                0x00000291      0x0000026e      0x00000273
      
      kfifo.c                 new             old
      text section size       0x00000be5      0x000008b2
      
      As you can see, kfifo_put/kfifo_get creates a little bit more code than
      kfifo_in/kfifo_out, but it is much faster (the code is inline).
      
      The code is complete hand crafted and optimized.  The text section size is
      as small as possible.  You get all the fifo handling in only 3 kb.  This
      includes type safe fix size records, dynamic records and DMA handling.
      
      This should be the final version. All requested features are implemented.
      
      Note: Most features of this API doesn't have any users.  All functions
      which are not used in the next 9 months will be removed.  So, please adapt
      your drivers and other sources as soon as possible to the new API and post
      it.
      
      This are the features which are currently not used in the kernel:
      
      kfifo_to_user()
      kfifo_from_user()
      kfifo_dma_....() macros
      kfifo_esize()
      kfifo_recsize()
      kfifo_put()
      kfifo_get()
      
      The fixed size record elements, exclude "unsigned char" fifo's and the
      variable size records fifo's
      
      This patch:
      
      User of the kernel fifo should never bypass the API and directly access
      the fifo structure.  Otherwise it will be very hard to maintain the API.
      Signed-off-by: default avatarStefani Seibold <stefani@seibold.net>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4457d984
    • Robert P. J. Day's avatar
      kfifo: kfifo_is_{full,empty} should return bools, not ints · ad9c7ed0
      Robert P. J. Day authored
      For consistency with other kfifo routines, return bool, not int.
      Signed-off-by: default avatarRobert P. J. Day <rpjday@crashcourse.ca>
      Cc: Stefani Seibold <stefani@seibold.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ad9c7ed0
    • Lubomir Rintel's avatar
      fs/sysv/super.c: add support for non-PDP11 v7 filesystems · ab654bab
      Lubomir Rintel authored
      This adds byte order autodetection (of PDP-11 and LE filesystems).  No
      attempt is made to detect big-endian filesystems -- were there any?
      Tested with PDP-11 v7 filesystems and PC-IX maintenance floppy.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ab654bab
    • Lubomir Rintel's avatar
      fs/sysv: v7: adjust sanity checks for some volumes · 0bcaa65a
      Lubomir Rintel authored
      Newly mkfs-ed filesystems from Seventh Edition have last modification time
      set to zero, but are otherwise perfectly valid.
      
      Also, tighten up other sanity checks to filter out most filesystems with
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0bcaa65a
    • Lubomir Rintel's avatar
      fs/sysv: add v7 alias · a36517e9
      Lubomir Rintel authored
      So that the module gets autoloaded when a v7 filesystem is mounted.
      Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a36517e9