1. 07 1月, 2012 1 次提交
  2. 04 1月, 2012 2 次提交
    • A
      udf: propagate umode_t · faa17292
      Al Viro 提交于
      note re mount options: fmask and dmask are explicitly truncated to 12bit,
      UDF_INVALID_MODE just needs to be guaranteed to differ from any such value.
      And umask is used only in &= with umode_t, so we ignore other bits anyway.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      faa17292
    • A
      vfs: fix the stupidity with i_dentry in inode destructors · 6b520e05
      Al Viro 提交于
      Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
      it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
      the cost of taking it into inode_init_always() will be negligible for pipes
      and sockets and negative for everything else.  Not to mention the removal of
      boilerplate code from ->destroy_inode() instances...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6b520e05
  3. 01 11月, 2011 5 次提交
  4. 11 10月, 2011 3 次提交
  5. 07 1月, 2011 9 次提交
    • N
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin 提交于
      RCU free the struct inode. This will allow:
      
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fa0d7e3d
    • A
      udf: Remove unnecessary bkl usages · 9db9f9e3
      Alessio Igor Bogani 提交于
      The udf_readdir(), udf_lookup(), udf_create(), udf_mknod(), udf_mkdir(),
      udf_rmdir(), udf_link(), udf_get_parent() and udf_unlink() seems already
      adequately protected by i_mutex held by VFS invoking calls. The udf_rename()
      instead should be already protected by lock_rename again by VFS. The
      udf_ioctl(), udf_fill_super() and udf_evict_inode() don't requires any further
      protection.
      
      This work was supported by a hardware donation from the CE Linux Forum.
      Signed-off-by: NAlessio Igor Bogani <abogani@texware.it>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9db9f9e3
    • A
      udf: Replace bkl with the UDF_I(inode)->i_data_sem for protect udf_inode_info struct · 4d0fb621
      Alessio Igor Bogani 提交于
      Replace bkl with the UDF_I(inode)->i_data_sem rw semaphore in
      udf_release_file(), udf_symlink(), udf_symlink_filler(), udf_get_block(),
      udf_block_map(), and udf_setattr(). The rule now is that any operation
      on regular file's or symlink's extents (or generally allocation information
      including goal block) needs to hold i_data_sem.
      
      This work was supported by a hardware donation from the CE Linux Forum.
      Signed-off-by: NAlessio Igor Bogani <abogani@texware.it>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4d0fb621
    • J
      udf: Remove BKL from free space counting functions · d1668fe3
      Jan Kara 提交于
      udf_count_free_bitmap() does not need BKL because bitmaps are in a fixed
      place on disk and so we can count set bits without serialization.
      udf_count_free_table() is now protected by s_alloc_mutex instead of BKL
      to get a consistent view of free space extents.
      Signed-off-by: NJan Kara <jack@suse.cz>
      d1668fe3
    • J
      udf: Remove BKL from udf_put_super() and udf_remount_fs() · 0484b1ce
      Jan Kara 提交于
      udf_put_super() does not need BKL because the filesystem is shut down so
      there's nothing to race with. The credential changes in udf_remount_fs()
      and LVID changes are now protected by dedicated locks so we can remove BKL
      from this function as well.
      Signed-off-by: NJan Kara <jack@suse.cz>
      0484b1ce
    • J
      udf: Protect default inode credentials by rwlock · c03cad24
      Jan Kara 提交于
      Superblock carries credentials (uid, gid, etc.) which are used as default
      values in __udf_read_inode() when media does not provide these. These
      credentials can change during remount so we protect them by a rwlock so that
      each inode gets a consistent set of credentials.
      Signed-off-by: NJan Kara <jack@suse.cz>
      c03cad24
    • J
      udf: Protect all modifications of LVID with s_alloc_mutex · 949f4a7c
      Jan Kara 提交于
      udf_open_lvid() and udf_close_lvid() were modifying LVID without
      s_alloc_mutex. Since they can be called from remount, the modification
      could race with other filesystem modifications of LVID so protect them
      by s_alloc_mutex just to be sure.
      Signed-off-by: NJan Kara <jack@suse.cz>
      949f4a7c
    • J
      udf: Move handling of uniqueID into a helper function and protect it by a s_alloc_mutex · d664b6af
      Jan Kara 提交于
      uniqueID handling has been duplicated in three places. Move it into a common
      helper. Since we modify an LVID buffer with uniqueID update, we take
      sbi->s_alloc_mutex to protect agaist other modifications of the structure.
      Signed-off-by: NJan Kara <jack@suse.cz>
      d664b6af
    • J
      fs/udf: Use vzalloc · ed2ae6f6
      Joe Perches 提交于
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      ed2ae6f6
  6. 29 10月, 2010 1 次提交
  7. 05 10月, 2010 1 次提交
    • J
      BKL: Explicitly add BKL around get_sb/fill_super · db719222
      Jan Blunck 提交于
      This patch is a preparation necessary to remove the BKL from do_new_mount().
      It explicitly adds calls to lock_kernel()/unlock_kernel() around
      get_sb/fill_super operations for filesystems that still uses the BKL.
      
      I've read through all the code formerly covered by the BKL inside
      do_kern_mount() and have satisfied myself that it doesn't need the BKL
      any more.
      
      do_kern_mount() is already called without the BKL when mounting the rootfs
      and in nfsctl. do_kern_mount() calls vfs_kern_mount(), which is called
      from various places without BKL: simple_pin_fs(), nfs_do_clone_mount()
      through nfs_follow_mountpoint(), afs_mntpt_do_automount() through
      afs_mntpt_follow_link(). Both later functions are actually the filesystems
      follow_link inode operation. vfs_kern_mount() is calling the specified
      get_sb function and lets the filesystem do its job by calling the given
      fill_super function.
      
      Therefore I think it is safe to push down the BKL from the VFS to the
      low-level filesystems get_sb/fill_super operation.
      
      [arnd: do not add the BKL to those file systems that already
             don't use it elsewhere]
      Signed-off-by: NJan Blunck <jblunck@infradead.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Christoph Hellwig <hch@infradead.org>
      db719222
  8. 10 8月, 2010 1 次提交
  9. 02 8月, 2010 1 次提交
  10. 24 5月, 2010 6 次提交
  11. 15 12月, 2009 1 次提交
    • J
      udf: Try harder when looking for VAT inode · e971b0b9
      Jan Kara 提交于
      Some disks do not contain VAT inode in the last recorded block as required
      by the standard but a few blocks earlier (or the number of recorded blocks
      is wrong). So look for the VAT inode a bit before the end of the media.
      Signed-off-by: NJan Kara <jack@suse.cz>
      e971b0b9
  12. 30 7月, 2009 1 次提交
  13. 12 6月, 2009 2 次提交
  14. 23 5月, 2009 1 次提交
  15. 02 4月, 2009 5 次提交
    • J
      udf: Don't write integrity descriptor too often · 146bca72
      Jan Kara 提交于
      We update information in logical volume integrity descriptor after each
      allocation (as LVID contains free space, number of directories and files on
      disk etc.). If the filesystem is on some phase change media, this leads to its
      quick degradation as such media is able to handle only 10000 overwrites or so.
      We solve the problem by writing new information into LVID only on umount,
      remount-ro and sync. This solves the problem at the price of longer media
      inconsistency (previously media became consistent after pdflush flushed dirty
      LVID buffer) but that should be acceptable.
      
      Report by and patch written in cooperation with
      Rich Coe <Richard.Coe@med.ge.com>.
      Signed-off-by: NJan Kara <jack@suse.cz>
      146bca72
    • J
      udf: Try anchor in block 256 first · 40346005
      Jan Kara 提交于
      Anchor block can be located at several places on the medium. Two of the
      locations are relative to media end which is problematic to detect. Also
      some drives report some block as last but are not able to read it or any
      block nearby before it. So let's first try block 256 and if it is all fine,
      don't look at other possible locations of anchor blocks to avoid IO errors.
      This change required a larger reorganization of code but the new code is
      hopefully more readable and definitely shorter.
      Signed-off-by: NJan Kara <jack@suse.cz>
      40346005
    • J
      udf: Some type fixes and cleanups · 225feded
      Jan Kara 提交于
      Make udf_check_valid() return 1 if the validity check passed and 0 otherwise.
      So far it was the other way around which was a bit confusing. Also make
      udf_vrs() return loff_t which is really the type it should return (not int).
      Signed-off-by: NJan Kara <jack@suse.cz>
      225feded
    • C
      udf: use hardware sector size · 1197e4df
      Clemens Ladisch 提交于
      This patch makes the UDF FS driver use the hardware sector size as the
      default logical block size, which is required by the UDF specifications.
      While the previous default of 2048 bytes was correct for optical disks,
      it was not for hard disks or USB storage devices, and made it impossible
      to use such a device with the default mount options.  (The Linux mkudffs
      tool uses a default block size of 2048 bytes even on devices with
      smaller hardware sectors, so this bug is unlikely to be noticed unless
      UDF-formatted USB storage devices are exchanged with other OSs.)
      
      To avoid regressions for people who use loopback optical disk images or
      who used the (sometimes wrong) defaults of mkudffs, we also try with
      a block size of 2048 bytes if no anchor was found with the hardware
      sector size.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      1197e4df
    • C
      udf: fix novrs mount option · 4136801a
      Clemens Ladisch 提交于
      The novrs mount option was broken due to a missing break.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4136801a