1. 28 Feb, 2013 1 commit
    • Alan Stern's avatar
      NLS: improve UTF8 -> UTF16 string conversion routine · 8eac4364
      Alan Stern authored
      commit 0720a06a
      
       upstream.
      
      The utf8s_to_utf16s conversion routine needs to be improved.  Unlike
      its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
      the maximum length of the output buffer or the endianness of its
      16-bit output.
      
      This patch (as1501) adds the two missing arguments, and adjusts the
      only two places in the kernel where the function is called.  A
      follow-on patch will add a third caller that does utilize the new
      capabilities.
      
      The two conversion routines are still annoyingly inconsistent in the
      way they handle invalid byte combinations.  But that's a subject for a
      different patch.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8eac4364
  2. 28 May, 2011 1 commit
  3. 26 May, 2011 2 commits
  4. 12 Apr, 2011 1 commit
  5. 10 Mar, 2011 1 commit
  6. 13 Jan, 2011 1 commit
  7. 07 Jan, 2011 4 commits
    • Nick Piggin's avatar
      fs: rcu-walk aware d_revalidate method · 34286d66
      Nick Piggin authored
      
      Require filesystems be aware of .d_revalidate being called in rcu-walk
      mode (nd->flags & LOOKUP_RCU). For now do a simple push down, returning
      -ECHILD from all implementations.
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
      34286d66
    • Nick Piggin's avatar
      fs: dcache reduce branches in lookup path · fb045adb
      Nick Piggin authored
      
      Reduce some branches and memory accesses in dcache lookup by adding dentry
      flags to indicate common d_ops are set, rather than having to check them.
      This saves a pointer memory access (dentry->d_op) in common path lookup
      situations, and saves another pointer load and branch in cases where we
      have d_op but not the particular operation.
      
      Patched with:
      
      git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
      fb045adb
    • Nick Piggin's avatar
      fs: change d_hash for rcu-walk · b1e6a015
      Nick Piggin authored
      
      Change d_hash so it may be called from lock-free RCU lookups. See similar
      patch for d_compare for details.
      
      For in-tree filesystems, this is just a mechanical change.
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
      b1e6a015
    • Nick Piggin's avatar
      fs: change d_compare for rcu-walk · 621e155a
      Nick Piggin authored
      
      Change d_compare so it may be called from lock-free RCU lookups. This
      does put significant restrictions on what may be done from the callback,
      however there don't seem to have been any problems with in-tree fses.
      If some strange use case pops up that _really_ cannot cope with the
      rcu-walk rules, we can just add new rcu-unaware callbacks, which would
      cause name lookup to drop out of rcu-walk mode.
      
      For in-tree filesystems, this is just a mechanical change.
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
      621e155a
  8. 29 Oct, 2010 1 commit
  9. 04 Oct, 2010 2 commits
    • Arnd Bergmann's avatar
      BKL: Remove BKL from fat · 3768744c
      Arnd Bergmann authored
      
      The lock_kernel in fat_put_super is not needed because
      it only protects the super block itself and we know that
      no other thread can reach it because we are about to
      kfree the object.
      
      In the two fill_super functions, this converts the locking
      to use lock_super like elsewhere in the fat code. This
      is probably not needed either, but is consistent and puts
      us on the safe side.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Jan Blunck <jblunck@infradead.org>
      3768744c
    • Jan Blunck's avatar
      BKL: Explicitly add BKL around get_sb/fill_super · db719222
      Jan Blunck authored
      
      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: default avatarJan Blunck <jblunck@infradead.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Christoph Hellwig <hch@infradead.org>
      db719222
  10. 31 Mar, 2010 1 commit
  11. 10 Feb, 2010 1 commit
  12. 11 Jan, 2010 1 commit
    • OGAWA Hirofumi's avatar
      fat: Fix vfat_lookup() · 8045e298
      OGAWA Hirofumi authored
      
      After d_find_alias(), vfat_lookup() checks !(->d_flags & DCACHE_DISCONNECTED)
      without IS_ROOT().  This means it hits non-anonymous but disconnected
      dentry. (NOTE: d_splice_alias() doesn't clear DCACHE_DISCONNECTED)
      
      But, vfat_lookup() has interest to alias if it was non-anonymous. So,
      this adds vfat_d_anon_disconn() helper to check it correctly.
      
      Another bug is refcnt leak. It needs dput() for uninterested alias.
      Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      8045e298
  13. 01 Aug, 2009 1 commit
    • OGAWA Hirofumi's avatar
      fat/nls: Fix handling of utf8 invalid char · 67638e40
      OGAWA Hirofumi authored
      
      With utf8 option, vfat allowed the duplicated filenames.
      
      Normal nls returns -EINVAL for invalid char. But utf8s_to_utf16s()
      skipped the invalid char historically.
      
      So, this changes the utf8s_to_utf16s() directly to return -EINVAL for
      invalid char, because vfat is only user of it.
      
      mkdir /mnt/fatfs
      FILENAME=`echo -ne "invalidutf8char_\\0341_endofchar"`
      echo "Using filename: $FILENAME"
      dd if=/dev/zero of=fatfs bs=512 count=128
      mkdosfs -F 32 fatfs
      mount -o loop,utf8 fatfs /mnt/fatfs
      touch "/mnt/fatfs/$FILENAME"
      umount /mnt/fatfs
      mount -o loop,utf8 fatfs /mnt/fatfs
      touch "/mnt/fatfs/$FILENAME"
      ls -l /mnt/fatfs
      umount /mnt/fatfs
      
      ----  And the output is:
      
      Using filename: invalidutf8char_\0341_endofchar
      128+0 records in
      128+0 records out
      65536 bytes (66 kB) copied, 0.000388118 s, 169 MB/s
      mkdosfs 2.11 (12 Mar 2005)
      total 0
      -rwxr-xr-x 1 root root 0 Jun 28 19:46 invalidutf8char__endofchar
      -rwxr-xr-x 1 root root 0 Jun 28 19:46 invalidutf8char__endofchar
      Tested-by: default avatarMarton Balint <cus@fazekas.hu>
      Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      67638e40
  14. 12 Jul, 2009 1 commit
  15. 16 Jun, 2009 1 commit
    • Alan Stern's avatar
      NLS: update handling of Unicode · 74675a58
      Alan Stern authored
      
      This patch (as1239) updates the kernel's treatment of Unicode.  The
      character-set conversion routines are well behind the current state of
      the Unicode specification: They don't recognize the existence of code
      points beyond plane 0 or of surrogate pairs in the UTF-16 encoding.
      
      The old wchar_t 16-bit type is retained because it's still used in
      lots of places.  This shouldn't cause any new problems; if a
      conversion now results in an invalid 16-bit code then before it must
      have yielded an undefined code.
      
      Difficult-to-read names like "utf_mbstowcs" are replaced with more
      transparent names like "utf8s_to_utf16s" and the ordering of the
      parameters is rationalized (buffer lengths come immediate after the
      pointers they refer to, and the inputs precede the outputs).
      Fortunately the low-level conversion routines are used in only a few
      places; the interfaces to the higher-level uni2char and char2uni
      methods have been left unchanged.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      74675a58
  16. 12 Jun, 2009 1 commit
  17. 03 Jun, 2009 1 commit
  18. 27 Mar, 2009 1 commit
  19. 11 Nov, 2008 1 commit
  20. 06 Nov, 2008 6 commits
  21. 25 Jul, 2008 1 commit
    • Joe Peterson's avatar
      fatfs: add UTC timestamp option · b271e067
      Joe Peterson authored
      
      Provide a new mount option ("tz=UTC") for DOS (vfat/msdos) filesystems,
      allowing timestamps to be in coordinated universal time (UTC) rather than
      local time in applications where doing this is advantageous.
      
      In particular, portable devices that use fat/vfat (such as digital
      cameras) can benefit from using UTC in their internal clocks, thus
      avoiding daylight saving time errors and general time ambiguity issues.
      The user of the device does not have to worry about changing the time when
      moving from place or when daylight saving changes.
      
      The new mount option, when set, disables the counter-adjustment that Linux
      currently makes to FAT timestamp info in anticipation of the normal
      userspace time zone correction.  When used in this new mode, all daylight
      saving time and time zone handling is done in userspace as is normal for
      many other filesystems (like ext3).  The default mode, which remains
      unchanged, is still appropriate when mounting volumes written in Windows
      (because of its use of local time).
      
      I originally based this patch on one submitted last year by Paul Collins,
      but I updated it to work with current source and changed variable/option
      naming.  Ogawa Hirofumi (who maintains these filesystems) and I discussed
      this patch at length on lkml, and he suggested using the option name in
      the attached version of the patch.  Barry Bouwsma pointed out a good
      addition to the patch as well.
      Signed-off-by: default avatarJoe Peterson <joe@skyrush.com>
      Signed-off-by: default avatarPaul Collins <paul@ondioline.org>
      Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Barry Bouwsma <free_beer_for_all@yahoo.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b271e067
  22. 20 Jun, 2008 1 commit
    • Linus Torvalds's avatar
      Replace BKL with superblock lock in fat/msdos/vfat · 8f593427
      Linus Torvalds authored
      
      This replaces the use of the BKL in the FAT family of filesystems with the
      existing superblock lock instead.
      
      The code already appears to do mostly proper locking with its own private
      spinlocks (and mutexes), but while the BKL could possibly have been
      dropped entirely, converting it to use the superblock lock (which is just
      a regular mutex) is the conservative thing to do.
      
      As a per-filesystem mutex, it not only won't have any of the possible
      latency issues related to the BKL, but the lock is obviously private to
      the particular filesystem instance and will thus not cause problems for
      entirely unrelated users like the BKL can.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      8f593427
  23. 30 Apr, 2008 1 commit
  24. 28 Apr, 2008 3 commits
  25. 07 Feb, 2008 1 commit
  26. 12 Feb, 2007 1 commit
  27. 16 Nov, 2006 1 commit
  28. 01 Oct, 2006 1 commit