26 Jun, 2006

40 commits

  • Super block of UFS usually has size >512, because of fragment size may be 512,
    this cause some problems.

    Currently, there are two methods to work with ufs super block:

    1) split structure which describes ufs super blocks into structures with
    size b_data + bh[n]->b_size == bh[n + 1]->b_data

    The second variant may cause some problems in the future, and usage of two
    variants cause unnecessary code duplication.

    This patch remove the second variant. Also patch contains some CodingStyle
    fixes.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • This patch fixes two bugs, which introduced by previous patches:

    1) Missed "brelse"

    2) Sometimes "baseblk" may be wrongly calculated, if i_size is equal to
    zero, which lead infinite cycle in "mpage_writepages".

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • fs/ufs/super.c: In function `ufs_print_super_stuff':
    fs/ufs/super.c:103: warning: unsigned int format, different type arg (arg 2) fs/ufs/super.c: In function `ufs2_print_super_stuff': fs/ufs/super.c:147: warning: unsigned int format, different type arg (arg 2) fs/ufs/super.c: In function `ufs_print_cylinder_stuff':
    fs/ufs/super.c:175: warning: unsigned int format, different type arg (arg 2)

    Cc: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Presently if we allocate several "metadata" blocks (pointers to indirect
    blocks for example), we fill with zeroes only the first block. This cause
    some problems in "truncate" function. Also this patch remove some unused
    arguments from several functions and add comments.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • ufs_free_blocks function looks now in so way:
    if (err)
    goto failed;
    lock_super();
    failed:
    unlock_super();

    So if error happen we'll unlock not locked super.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • At now UFS code uses DQUOT_* mechanism, but it also update inode->i_blocks
    manually, this cause wrong i_blocks value.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • This patch make little optimization of ufs_find_entry like "ext2" does. Save
    number of page and reuse it again in the next call.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • Currently to turn on debug mode "user" has to edit ~10 files, to turn off he
    has to do it again.

    This patch introduce such changes:
    1)turn on(off) debug messages via ".config"
    2)remove unnecessary duplication of code
    3)make "UFSD" macros more similar to function
    4)fix some compiler warnings

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • To find new bugs, I suggest revert this patch:
    http://lkml.org/lkml/2006/1/31/275 in -mm tree.

    So others can test "write support" of UFS.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • The writing to UFS file system with block/fragment!=8 may cause bogus
    behaviour. The problem in "ufs_bitmap_search" function, which doesn't work
    correctly in "block/fragment!=8" case. The idea is stolen from BSD code.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • There are two ugly macros in ufs code:
    #define UCPI_UBH ((struct ufs_buffer_head *)ucpi)
    #define USPI_UBH ((struct ufs_buffer_head *)uspi)
    when uspi looks like
    struct {
    struct ufs_buffer_head ;
    }
    and USPI_UBH has some sence,
    ucpi looks like
    struct {
    struct not_ufs_buffer_head;
    }

    To prevent bugs in future, this patch convert macros to inline function and
    fix "ucpi" structure.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • Change function in fs/ufs/dir.c and fs/ufs/namei.c to work with pages
    instead of straight work with blocks. It fixed such bugs:

    * for i in `seq 1 1000`; do touch $i; done - crash system
    * mkdir create directory without "." and ".." entries

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • This series of patches finished "bugs fixing" mentioned
    here http://lkml.org/lkml/2006/1/31/275 .

    The main bugs:
    * for i in `seq 1 1000`; do touch $i; done - crash system
    * mkdir create directory without "." and ".." entries

    The suggested solution is work with page cache instead of straight work
    with blocks. Such solution has following advantages

    * reduce code size and its complexity
    * some global locks go away
    * fix bugs

    The most part of code is stolen from ext2, because of it has similar
    directory structure.

    Patches testes with UFS1 and UFS2 file systems.

    This patch installs i_mapping->a_ops for directory inodes and removes some
    duplicated code.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • First of all some necessary notes about UFS by it self: To avoid waste of disk
    space the tail of file consists not from blocks (which is ordinary big enough,
    16K usually), it consists from fragments(which is ordinary 2K). When file is
    growing its tail occupy 1 fragment, 2 fragments... At some stage decision to
    allocate whole block is made and all fragments are moved to one block.

    How this situation was handled before:

    ufs_prepare_write
    ->block_prepare_write
    ->ufs_getfrag_block
    ->...
    ->ufs_new_fragments:

    bh = sb_bread
    bh->b_blocknr = result + i;
    mark_buffer_dirty (bh);

    This is wrong solution, because:

    - it didn't take into consideration that there is another cache: "inode page
    cache"

    - because of sb_getblk uses not b_blocknr, (it uses page->index) to find
    certain block, this breaks sb_getblk.

    How this situation is handled now: we go though all "page inode cache", if
    there are no such page in cache we load it into cache, and change b_blocknr.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • * After block allocation, we map it on the same "address" as 8 others
    blocks

    * We nullify block several times: once in ufs/block.c and once in
    block_*write_full_page, and use different "caches" for this.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • Currently, ufs write support have two sets of problems: work with files and
    work with directories.

    This series of patches should solve the first problem.

    This patch is similar to http://lkml.org/lkml/2006/1/17/61 this patch
    complements it.

    The situation the same: in ufs_trunc_(not direct), we read block, check if
    count of links to it is equal to one, if so we finish cycle, if not
    continue. Because of "count of links" always >=2 this operation cause
    infinite cycle and hang up the kernel.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • We can leak `clink' if drv->probe == 0.

    Signed-off-by: Jesper Juhl
    Cc: Adam Belay
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Fix of some spelling errors in fs/freevxfs error messages and comments

    Signed-off-by: Cliff Wickman
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cliff Wickman
     
  • Since raw_notifier chains don't benefit from any centralized locking
    protections, they shouldn't suffer from the associated limitations. Under
    some circumstances it might make sense for a raw_notifier callout routine
    to unregister itself from the notifier chain. This patch (as678) changes
    the notifier core to allow for such things.

    Signed-off-by: Alan Stern
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Stern
     
  • There are several instances of per_cpu(foo, raw_smp_processor_id()), which
    is semantically equivalent to __get_cpu_var(foo) but without the warning
    that smp_processor_id() can give if CONFIG_DEBUG_PREEMPT is enabled. For
    those architectures with optimized per-cpu implementations, namely ia64,
    powerpc, s390, sparc64 and x86_64, per_cpu() turns into more and slower
    code than __get_cpu_var(), so it would be preferable to use __get_cpu_var
    on those platforms.

    This defines a __raw_get_cpu_var(x) macro which turns into per_cpu(x,
    raw_smp_processor_id()) on architectures that use the generic per-cpu
    implementation, and turns into __get_cpu_var(x) on the architectures that
    have an optimized per-cpu implementation.

    Signed-off-by: Paul Mackerras
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Acked-by: Martin Schwidefsky
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mackerras
     
  • The core input layer is already calling add_input_randomness.

    Signed-off-by: Matt Mackall
    Cc: Dmitry Torokhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Disk devices should use add_disk_randomness rather than SA_SAMPLE_RANDOM

    Signed-off-by: Matt Mackall
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Disk devices should use the add_disk_randomness API rather than
    SA_SAMPLE_RANDOM.

    Signed-off-by: Matt Mackall
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • The floppy driver is already calling add_disk_randomness as it should, so this
    was redundant.

    Signed-off-by: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Upgrade scripts/bloat-o-meter to handle the names gcc 4 gives static
    symbols.

    Signed-off-by: Rob Landley
    Signed-off-by: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rob Landley
     
  • If CONFIG_KALLSYMS is defined and if it should happen that is_exported() is
    given a NULL 'mod' and lookup_symbol(name, __start___ksymtab,
    __stop___ksymtab) returns 0, then we'll end up dereferencing a NULL
    pointer.

    Signed-off-by: Jesper Juhl
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • This patch contains a total rewrite of the backlight infrastructure for
    portable Apple computers. Backward compatibility is retained. A sysfs
    interface allows userland to control the brightness with more steps than
    before. Userland is allowed to upload a brightness curve for different
    monitors, similar to Mac OS X.

    [akpm@osdl.org: add needed exports]
    Signed-off-by: Michael Hanselmann
    Acked-by: Benjamin Herrenschmidt
    Cc: Richard Purdie
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Hanselmann
     
  • Became irrelevant when x86_64 unexported ia32_sys_call_table.

    Signed-off-by: Adrian Bunk
    Cc: Andi Kleen
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Convert the generic irq code to use irq controller, this gets rid of the
    machine specific callbacks and gives better control over irq handling without
    duplicating lots of code.

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Introduce irq controller and use it to manage auto vector interrupts.
    Introduce setup_irq() which can be used for irq setup.

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Fix amiga irq numbering, so they are after the generic IRQ_AUTO defines and
    remove the IRQ_AMIGA_AUTO defines.

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Rename IRQ1..IRQ7 to IRQ_AUTO_1..IRQ_AUTO_7 and remove the duplicate
    defintions.

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel