04 Jan, 2012

1 commit


01 Nov, 2011

1 commit

  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

21 Jul, 2011

2 commits

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     
  • Add a new rw_semaphore to protect bmap against truncate. Previous
    i_alloc_sem was abused for this, but it's going away in this series.

    Note that we can't simply use i_mutex, given that the swapon code
    calls ->bmap under it.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

12 Apr, 2011

3 commits


13 Jan, 2011

1 commit


10 Aug, 2010

1 commit

  • Make sure we check the truncate constraints early on in ->setattr by adding
    those checks to inode_change_ok. Also clean up and document inode_change_ok
    to make this obvious.

    As a fallout we don't have to call inode_newsize_ok from simple_setsize and
    simplify it down to a truncate_setsize which doesn't return an error. This
    simplifies a lot of setattr implementations and means we use truncate_setsize
    almost everywhere. Get rid of fat_setsize now that it's trivial and mark
    ext2_setsize static to make the calling convention obvious.

    Keep the inode_newsize_ok in vmtruncate for now as all callers need an
    audit for its removal anyway.

    Note: setattr code in ecryptfs doesn't call inode_change_ok at all and
    needs a deeper audit, but that is left for later.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

28 May, 2010

2 commits


25 May, 2010

1 commit


17 May, 2010

1 commit

  • FAT does not require the BKL in its ioctl function, which is already serialized
    through a mutex. Since we're already touching the ioctl code, also fix the
    missing handling of FAT_IOCTL_GET_ATTRIBUTES in the compat code.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: OGAWA Hirofumi

    Arnd Bergmann
     

21 Nov, 2009

1 commit

  • Currently shipping discard capable SSDs and arrays have rather sub-optimal
    implementations of the command and can the use of it can cause massive
    slowdowns. Make issueing these commands option as it's already in btrfs
    and gfs2.

    Signed-off-by: Christoph Hellwig
    [hirofumi@mail.parknet.co.jp: tweaks, and add "discard" to fat_show_options]
    Signed-off-by: OGAWA Hirofumi

    Christoph Hellwig
     

20 Sep, 2009

1 commit

  • If we didn't check sb->s_dirt, it will update the FSINFO
    unconditionally. It will reduce the filetime of flash base device.

    So, this checks sb->s_dirt. sb->s_dirt is racy, however FSINFO is just
    hint. So even if there is race, and we hit it, it would not become big
    problem.

    And this also is as workaround of suspend problem.

    Signed-off-by: OGAWA Hirofumi

    OGAWA Hirofumi
     

17 Jun, 2009

1 commit


12 Jun, 2009

1 commit

  • * mark directory data blocks as assoc. metadata
    * add new inode to deal with FAT, mark FAT blocks as assoc. metadata of that
    * now ->fsync() is trivial both for files and directories

    Signed-off-by: Al Viro

    Al Viro
     

04 Jun, 2009

1 commit

  • On severe errors FAT remounts itself in read-only mode. Allow to
    specify FAT fs desired behavior through 'errors' mount option:
    panic, continue or remount read-only.

    `mount -t [fat|vfat] -o errors=[panic,remount-ro,continue] \
    `

    This is analog to ext2 fs 'errors' mount option.

    Signed-off-by: Denis Karpov
    Signed-off-by: OGAWA Hirofumi

    Denis Karpov
     

07 Nov, 2008

9 commits

  • blkcnt_t type depends on CONFIG_LSF. Use unsigned long long always for
    printk(). But lazy to type it, so add "llu" and use it.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • mmu_private is 64bits value, hence it's not atomic to update.

    So, the access rule for mmu_private is we must hold ->i_mutex. But,
    fat_get_block() path doesn't follow the rule on non-allocation path.

    This fixes by using i_size instead if non-allocation path.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • FAT has the ATTR_RO (read-only) attribute. But on Windows, the ATTR_RO
    of the directory will be just ignored actually, and is used by only
    applications as flag. E.g. it's setted for the customized folder by
    Explorer.

    http://msdn2.microsoft.com/en-us/library/aa969337.aspx

    This adds "rodir" option. If user specified it, ATTR_RO is used as
    read-only flag even if it's the directory. Otherwise, inode->i_mode
    is not used to hold ATTR_RO (i.e. fat_mode_can_save_ro() returns 0).

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • If inode->i_mode doesn't have S_WUGO, current code assumes it means
    ATTR_RO. However, if (~[ufd]mask & S_WUGO) == 0, inode->i_mode can't
    hold S_WUGO. Therefore the updated directory entry will always have
    ATTR_RO.

    This adds fat_mode_can_hold_ro() to check it. And if inode->i_mode
    can't hold, uses -i_attrs to hold ATTR_RO instead.

    With this, we don't set ATTR_RO unless users change it via ioctl() if
    (~[ufd]mask & S_WUGO) == 0.

    And on FAT_IOCTL_GET_ATTRIBUTES path, this adds ->i_mutex to it for
    not returning the partially updated attributes by FAT_IOCTL_SET_ATTRIBUTES
    to userland.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This adds three helpers:

    fat_make_attrs() - makes FAT attributes from inode.
    fat_make_mode() - makes mode_t from FAT attributes.
    fat_save_attrs() - saves FAT attributes to inode.

    Then this replaces: MSDOS_MKMODE() by fat_make_mode(), fat_attr() by
    fat_make_attrs(), ->i_attrs = attr & ATTR_UNUSED by fat_save_attrs().
    And for root inode, those is used with ATTR_DIR instead of bogus
    ATTR_NONE.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • fat_hash() is using the algorithm known as bad. Instead of it, this
    uses hash_32(). The following is the summary of test.

    old hash:
    hash func (1000 times): 33489 cycles
    total inodes in hash table: 70926
    largest bucket contains: 696
    smallest bucket contains: 54

    new hash:
    hash func (1000 times): 33129 cycles
    total inodes in hash table: 70926
    largest bucket contains: 315
    smallest bucket contains: 236

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This cleans date_dos2unix()/fat_date_unix2dos() up. New code should be
    much more readable.

    And this fixes those old functions. Those doesn't handle 2100
    correctly. 2100 isn't leap year, but old one handles it as leap year.
    Also, with this, centi sec is handled and is fixed.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This splits __KERNEL__ stuff in include/msdos_fs.h into fs/fat/fat.h.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi