17 Apr, 2008

27 commits

  • As pointed out by Sergey Vlasov, UDF implements its own version of
    the CRC ITU-T V.41. Convert it to use the one in the library.

    Signed-off-by: Bob Copeland
    Cc: Sergey Vlasov
    Signed-off-by: Jan Kara

    Bob Copeland
     
  • Fix two compilation warnings (and actual bugs in message formatting)
    when UDF debugging is turned on.

    Signed-off-by: Sebastian Manciulea
    Signed-off-by: Jan Kara

    Sebastian Manciulea
     
  • Fix mapping of blocks using VAT when it is stored in an inode.
    UDF_I(inode)->i_data already points to the beginning of VAT header so there's
    no need to add udf_ext0_offset(inode).

    Signed-off-by: Sebastian Manciulea
    Signed-off-by: Jan Kara

    Sebastian Manciulea
     
  • This patch implements parsing of metadata partitions and reading of Metadata
    File thus allowing to read UDF 2.50 media. Error resilience is implemented
    through accessing the Metadata Mirror File in case the data the Metadata File
    cannot be read. The patch is based on the original patch by Sebastian Manciulea
    and Mircea Fedoreanu .

    Signed-off-by: Sebastian Manciulea
    Signed-off-by: Mircea Fedoreanu
    Signed-off-by: Jan Kara

    Jan Kara
     
  • According to OSTA UDF specification, only anchor blocks and primary volume
    descriptors are placed on media relative to the last session. All other block
    numbers are absolute (in the partition or the whole media). This seems to be
    confirmed by multisession media created by other systems.

    Signed-off-by: Sebastian Manciulea
    Signed-off-by: Jan Kara

    Sebastian Manciulea
     
  • As we don't properly support writing to pseudooverwrite partition (we should
    add entries to VAT and relocate blocks instead of just writing them), mount
    filesystems with such partition as read-only.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • We didn't handle VAT packed inside the inode - we tried to call udf_block_map()
    on such file which lead to strange results at best. Add proper handling of
    packed VAT as we do it with other packed files.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • We incorrectly (way to strictly) checked version of VAT on loading and thus
    refuse to mount correct media. There are just two format versions - below 2.0
    and above 2.0 and we understand both. So update the version check accordingly.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Some of the computed positions of anchor block could be beyond the end of
    device. Skip reading such blocks.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Add +1 and -1 to a list of blocks which can be the
    real last recorded block on a UDF media. Sebastian Manciulea
    claims this helps some drive + media combinations
    he is able to test.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • UDF anchor block detection is complicated by several things - there are several
    places where the anchor point can be, some of them relative to the last
    recorded block which some devices report wrongly. Moreover some devices on some
    media seem to have 7 spare blocks sectors for every 32 blocks (at least as far
    as I understand the old code) so we have to count also with that possibility.

    This patch splits anchor block detection into several functions so that it is
    clearer what we actually try to do. We fix several bugs of the type "for such
    and such media, we fail to check block blah" as a result of the cleanup.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • This patch move processing of UDF virtual partitions close to the place
    where other partition types are processed. As a result we now also
    properly fill in partition access type.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Signed-off-by: Jan Kara

    Jan Kara
     
  • Report error when we fail to allocate memory for a bitmap and properly
    release allocated memory and inodes for all the partitions in case of
    mount failure and umount.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Cleanup processing of volume descriptor sequence so that it is more readable,
    make code handle errors (e.g. media problems) better.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • According to ECMA 167 rev. 3 (see 3/8.4.2.1), Anchor Volume Descriptor
    Pointer should be recorded at two or more anchor points located at sectors
    256, N, N - 256, where N - is a largest logical sector number at volume
    space.

    So we should always try to detect N on UDF volume before trying to find
    Anchor Volume Descriptor (i.e. calling to udf_find_anchor()).

    That said, all this patch does is updates the s_last_block even if the
    udf_vrs() returns positive value.

    Originally written and tested by Yuri Per, ported on latest mainline by me.

    Signed-off-by: Yuri Per
    Signed-off-by: Pavel Emelyanov
    Cc: Max Lyadvinsky
    Cc: Vladimir Simonov
    Cc: Andrew Neporada
    Cc: Kirill Korotaev
    Signed-off-by: Jan Kara

    Pavel Emelyanov
     
  • Mark udf_process_sequence() as noinline since stack usage is terrible
    otherwise.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • reorganize few code blocks in super.c which
    were needlessly indented (and hard to read):

    so change from:
    rettype fun()
    {
    init;
    if (sth) {
    long block of code;
    }
    }

    to:
    rettype fun()
    {
    init;
    if (!sth)
    return;
    long block of code;
    }

    or

    from:
    rettype fun2()
    {
    init;
    while (sth) {
    init2();
    if (sth2) {
    long block of code;
    }
    }
    }

    to:
    rettype fun2()
    {
    init;
    while (sth) {
    init2();
    if (!sth2)
    continue;
    long block of code;
    }
    }

    Signed-off-by: Marcin Slusarz
    Signed-off-by: Jan Kara

    Marcin Slusarz
     
  • remove now unneeded kernel_timestamp type with conversion functions

    Signed-off-by: Marcin Slusarz
    Signed-off-by: Jan Kara

    Marcin Slusarz
     
  • * kernel_timestamp type was almost unused - only callers of udf_stamp_to_time
    and udf_time_to_stamp used it, so let these functions handle endianness
    internally and don't clutter code with conversions

    * rename udf_stamp_to_time to udf_disk_stamp_to_time
    and udf_time_to_stamp to udf_time_to_disk_stamp

    Signed-off-by: Marcin Slusarz
    Signed-off-by: Jan Kara

    Marcin Slusarz
     
  • Signed-off-by: Marcin Slusarz
    Signed-off-by: Jan Kara

    marcin.slusarz@gmail.com
     
  • replace handwritten bits counting with bitmap_weight

    Signed-off-by: Marcin Slusarz
    Signed-off-by: Jan Kara

    Marcin Slusarz
     
  • This patch makes the needlessly global udf_error() static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Jan Kara

    Adrian Bunk
     
  • The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
    (d)) but is perhaps more readable.

    An extract of the semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @haskernel@
    @@

    #include

    @depends on haskernel@
    expression n,d;
    @@

    (
    - (n + d - 1) / d
    + DIV_ROUND_UP(n,d)
    |
    - (n + (d - 1)) / d
    + DIV_ROUND_UP(n,d)
    )

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP((n),d)
    + DIV_ROUND_UP(n,d)

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP(n,(d))
    + DIV_ROUND_UP(n,d)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Jan Kara

    Julia Lawall
     
  • There's really no reason to keep udf headers in include/linux as they're
    not used by anything but fs/udf/.

    This patch merges most of include/linux/udf_fs_i.h into fs/udf/udf_i.h,
    include/linux/udf_fs_sb.h into fs/udf/udf_sb.h and
    include/linux/udf_fs.h into fs/udf/udfdecl.h.

    The only thing remaining in include/linux/ is a stub of udf_fs_i.h
    defining the four user-visible udf ioctls. It's also moved from
    unifdef-y to headers-y because it can be included unconditionally now.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • There's not need to document vfs method invocation rules, we have
    Documentation/filesystems/vfs.txt and Documentation/filesystems/Locking
    for that. Also a lot of these comments where either plain wrong or
    horrible out of date.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • This helper has been quite useless since sb_min_blocksize was introduced
    and is misnamed while we're at it. Just opencode the few lines in the
    caller instead.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     

09 Feb, 2008

13 commits

  • Add a .show_options super operation to udf.

    Signed-off-by: Miklos Szeredi
    Acked-by: Cyrill Gorcunov
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Printing date and version of a driver makes sense if there's a maintainer
    who's maintaining and using these, but printing ancient version information
    only confuses users.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Signed-off-by: Marcin Slusarz
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • Signed-off-by: Marcin Slusarz
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • convert byte order of constant instead of variable,
    which can be done at compile time (vs run time)

    Signed-off-by: Marcin Slusarz
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • Signed-off-by: Marcin Slusarz
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • fix coding style errors found by checkpatch:
    - assignments in if conditions
    - braces {} around single statement blocks
    - no spaces after commas
    - printks without KERN_*
    - lines longer than 80 characters
    - spaces between "type *" and variable name

    before: 192 errors, 561 warnings, 8987 lines checked
    after: 1 errors, 38 warnings, 9468 lines checked

    Signed-off-by: Marcin Slusarz
    Cc: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • fix sparse warnings:
    fs/udf/super.c:1431:24: warning: symbol 'bh' shadows an earlier one
    fs/udf/super.c:1347:21: originally declared here
    fs/udf/super.c:472:6: warning: symbol 'udf_write_super' was not declared. Should it be static?

    Signed-off-by: Marcin Slusarz
    Cc: Ben Fennema
    Cc: Jan Kara
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • Signed-off-by: Marcin Slusarz
    Cc: Ben Fennema
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • convert UDF_SB_ALLOC_BITMAP macro to udf_sb_alloc_bitmap function
    convert UDF_SB_FREE_BITMAP macro to udf_sb_free_bitmap function

    Signed-off-by: Marcin Slusarz
    Cc: Ben Fennema
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • udf_load_logicalvol may fail eg in out of memory conditions - check it
    and propagate error further

    Signed-off-by: Marcin Slusarz
    Cc: Ben Fennema
    Acked-by: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • - convert UDF_SB_ALLOC_PARTMAPS macro to udf_sb_alloc_partition_maps function
    - convert kmalloc + memset to kcalloc
    - check if kcalloc failed (partially)

    Signed-off-by: Marcin Slusarz
    Cc: Ben Fennema
    Cc: Jan Kara
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • remove macros:
    - UDF_SB_PARTMAPS
    - UDF_SB_PARTTYPE
    - UDF_SB_PARTROOT
    - UDF_SB_PARTLEN
    - UDF_SB_PARTVSN
    - UDF_SB_PARTNUM
    - UDF_SB_TYPESPAR
    - UDF_SB_TYPEVIRT
    - UDF_SB_PARTFUNC
    - UDF_SB_PARTFLAGS
    - UDF_SB_VOLIDENT
    - UDF_SB_NUMPARTS
    - UDF_SB_PARTITION
    - UDF_SB_SESSION
    - UDF_SB_ANCHOR
    - UDF_SB_LASTBLOCK
    - UDF_SB_LVIDBH
    - UDF_SB_LVID
    - UDF_SB_UMASK
    - UDF_SB_GID
    - UDF_SB_UID
    - UDF_SB_RECORDTIME
    - UDF_SB_SERIALNUM
    - UDF_SB_UDFREV
    - UDF_SB_FLAGS
    - UDF_SB_VAT
    - UDF_UPDATE_UDFREV
    - UDF_SB_FREE
    and open code them

    convert UDF_SB_LVIDIU macro to udf_sb_lvidiu function

    rename some struct udf_sb_info fields:
    - s_volident to s_volume_ident
    - s_lastblock to s_last_block
    - s_lvidbh to s_lvid_bh
    - s_recordtime to s_record_time
    - s_serialnum to s_serial_number;
    - s_vat to s_vat_inode;

    Signed-off-by: Marcin Slusarz
    Cc: Ben Fennema
    Cc: Jan Kara
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz