1. 02 6月, 2012 1 次提交
  2. 14 5月, 2012 1 次提交
  3. 27 3月, 2012 5 次提交
  4. 10 1月, 2012 1 次提交
    • A
      mtd: harmonize mtd_writev usage · 1dbebd32
      Artem Bityutskiy 提交于
      This patch makes the 'mtd_writev()' function more usable and logical. We first
      teach it to fall-back to the 'default_mtd_writev()' function if the MTD driver
      does not define its own '->writev()' method. Then we make block2mtd and JFFS2
      just 'mtd_writev()' instead of 'default_mtd_writev()' function. This means we
      can now stop exporting 'default_mtd_writev()' and instead, export
      'mtd_writev()'. This is much cleaner and more logical, as well as allows us to
      get read of another direct 'mtd->writev' access in JFFS2.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      1dbebd32
  5. 04 1月, 2012 1 次提交
  6. 25 5月, 2011 1 次提交
  7. 31 3月, 2011 1 次提交
  8. 13 11月, 2010 3 次提交
    • T
      block: clean up blkdev_get() wrappers and their users · d4d77629
      Tejun Heo 提交于
      After recent blkdev_get() modifications, open_by_devnum() and
      open_bdev_exclusive() are simple wrappers around blkdev_get().
      Replace them with blkdev_get_by_dev() and blkdev_get_by_path().
      
      blkdev_get_by_dev() is identical to open_by_devnum().
      blkdev_get_by_path() is slightly different in that it doesn't
      automatically add %FMODE_EXCL to @mode.
      
      All users are converted.  Most conversions are mechanical and don't
      introduce any behavior difference.  There are several exceptions.
      
      * btrfs now sets FMODE_EXCL in btrfs_device->mode, so there's no
        reason to OR it explicitly on blkdev_put().
      
      * gfs2, nilfs2 and the generic mount_bdev() now set FMODE_EXCL in
        sb->s_mode.
      
      * With the above changes, sb->s_mode now always should contain
        FMODE_EXCL.  WARN_ON_ONCE() added to kill_block_super() to detect
        errors.
      
      The new blkdev_get_*() functions are with proper docbook comments.
      While at it, add function description to blkdev_get() too.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: Joern Engel <joern@lazybastard.org>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
      Cc: reiserfs-devel@vger.kernel.org
      Cc: xfs-masters@oss.sgi.com
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      d4d77629
    • T
      block: make blkdev_get/put() handle exclusive access · e525fd89
      Tejun Heo 提交于
      Over time, block layer has accumulated a set of APIs dealing with bdev
      open, close, claim and release.
      
      * blkdev_get/put() are the primary open and close functions.
      
      * bd_claim/release() deal with exclusive open.
      
      * open/close_bdev_exclusive() are combination of open and claim and
        the other way around, respectively.
      
      * bd_link/unlink_disk_holder() to create and remove holder/slave
        symlinks.
      
      * open_by_devnum() wraps bdget() + blkdev_get().
      
      The interface is a bit confusing and the decoupling of open and claim
      makes it impossible to properly guarantee exclusive access as
      in-kernel open + claim sequence can disturb the existing exclusive
      open even before the block layer knows the current open if for another
      exclusive access.  Reorganize the interface such that,
      
      * blkdev_get() is extended to include exclusive access management.
        @holder argument is added and, if is @FMODE_EXCL specified, it will
        gain exclusive access atomically w.r.t. other exclusive accesses.
      
      * blkdev_put() is similarly extended.  It now takes @mode argument and
        if @FMODE_EXCL is set, it releases an exclusive access.  Also, when
        the last exclusive claim is released, the holder/slave symlinks are
        removed automatically.
      
      * bd_claim/release() and close_bdev_exclusive() are no longer
        necessary and either made static or removed.
      
      * bd_link_disk_holder() remains the same but bd_unlink_disk_holder()
        is no longer necessary and removed.
      
      * open_bdev_exclusive() becomes a simple wrapper around lookup_bdev()
        and blkdev_get().  It also has an unexpected extra bdev_read_only()
        test which probably should be moved into blkdev_get().
      
      * open_by_devnum() is modified to take @holder argument and pass it to
        blkdev_get().
      
      Most of bdev open/close operations are unified into blkdev_get/put()
      and most exclusive accesses are tested atomically at the open time (as
      it should).  This cleans up code and removes some, both valid and
      invalid, but unnecessary all the same, corner cases.
      
      open_bdev_exclusive() and open_by_devnum() can use further cleanup -
      rename to blkdev_get_by_path() and blkdev_get_by_devt() and drop
      special features.  Well, let's leave them for another day.
      
      Most conversions are straight-forward.  drbd conversion is a bit more
      involved as there was some reordering, but the logic should stay the
      same.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NNeil Brown <neilb@suse.de>
      Acked-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Acked-by: NMike Snitzer <snitzer@redhat.com>
      Acked-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Cc: Peter Osterlund <petero2@telia.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Alex Elder <aelder@sgi.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: dm-devel@redhat.com
      Cc: drbd-dev@lists.linbit.com
      Cc: Leo Chen <leochen@broadcom.com>
      Cc: Scott Branden <sbranden@broadcom.com>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Joern Engel <joern@logfs.org>
      Cc: reiserfs-devel@vger.kernel.org
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      e525fd89
    • T
      mtd: fix bdev exclusive open bugs in block2mtd::add_device() · 731edacb
      Tejun Heo 提交于
      There are two bdev exclusive open bugs.
      
      * open_bdev_exclusive() must not be called with NULL holder.  Use dev
        as the holder.
      
      * open_by_devnum() doesn't open the bdev exclusively but
        block2mtd_free_device() always assumes it.  Explicitly claim the
        bdev.
      
      The latter is rather clumsy but will be simplified with future
      blkdev_get/put() cleanups.
      
      - Updated to use local variable @mode to cache FMODE_* masks as
        suggested by Artem Bityutskiy.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: linux-mtd@lists.infradead.org
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      731edacb
  9. 26 10月, 2010 1 次提交
  10. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. 18 3月, 2010 1 次提交
  12. 21 10月, 2008 1 次提交
  13. 22 7月, 2008 1 次提交
  14. 05 6月, 2008 1 次提交
  15. 22 4月, 2008 1 次提交
  16. 25 3月, 2008 1 次提交
  17. 07 2月, 2008 1 次提交
  18. 08 5月, 2007 1 次提交
  19. 02 5月, 2007 1 次提交
  20. 21 2月, 2007 3 次提交
  21. 12 2月, 2007 1 次提交
  22. 29 11月, 2006 1 次提交
  23. 15 7月, 2006 1 次提交
    • V
      block2mtd.c: Make kernel boot command line arguments work (try 4) · c4e7fb31
      Ville Herva 提交于
      Trying to pass kernel command line arguments to block2mtd at boot-time does
      not work currently. block2mtd_setup() is called so early that kmalloc()
      fails nevermind being able to do open_bdev_excl() (which requires rootfs to
      be mounted. This patch only saves the option string at the early boot stage,
      and parses them later when block2mtd_init() is called. If open_bdev_excl()
      fails, open_by_devnum(name_to_dev_t()) is tried instead, which makes it
      possible to initialize the driver before rootfs has been mounted. Also gets
      rid of the superfluous parse_name() that only checks if name is longer than
      80 chars and copies it to a string that is not kfreed.
      
      With this patch, I can boot statically compiled block2mtd, and mount jffs2
      as rootfs (without modules or initrd), with lilo config like this:
      
         root=/dev/mtdblock0
         append="rootfstype=jffs2 block2mtd.block2mtd=/dev/hdc2,65536"
      
      (Note that rootfstype=jffs2 is required, since the kernel only tries
      filesystems without "nodev" attribute by default, and jffs is "nodev").
      
      Compared to first version of this patch, this one does not copy the
      parameters to the global buffer if init has already been called, and the
      global array is marked as __initdata.
      
      Compared to the second version of this patch, module build is fixed.
      
      Compared to the third version of this patch, statically compiled block2mtd
      driver with no boot-time parameter no longer gives spurious error 'cannot
      open device ""'
      Signed-off-by: NVille Herva <vherva@vianova.fi>
      Acked-by: NJörn Engel <joern@wohnheim.fh-wedel.de>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      c4e7fb31
  24. 01 7月, 2006 1 次提交
  25. 22 6月, 2006 1 次提交
  26. 15 6月, 2006 1 次提交
  27. 30 5月, 2006 1 次提交
  28. 25 5月, 2006 1 次提交
  29. 14 5月, 2006 2 次提交
  30. 19 4月, 2006 1 次提交
    • J
      mtd: improve parameter parsing for block2mtd · 954c2422
      Joern Engel 提交于
      Expand the parameter parsing for block2mtd.  It now accepts:
      Ki, Mi, Gi	- the official prefixes for binary multiples,
      		  see http://physics.nist.gov/cuu/Units/binary.html,
      ki		- mistake on my side and analog to "k" for decimal multiples,
      KiB, MiB, GiB	- for people that prefer to add a "B" for byte,
      kiB		- combination of the above.
      
      There were complaints about not accepting "k" for 1024.  This has long
      been common practice, but is known to lead to confusion.  Hence the new
      SI units and hence block2mtd only accepts units that cannot be confused
      with decimal units.  Diverging from common practice doesn't always please
      people, even if the change is for the better.
      Signed-off-by: NJoern Engel <joern@wohnheim.fh-wedel.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      954c2422
  31. 01 4月, 2006 1 次提交