1. 01 6月, 2012 1 次提交
    • N
      fat: use fat_msg_ratelimit() in fat__get_entry() · f0aac616
      Namjae Jeon 提交于
      If an application tries to lookup (opendir/readdir/stat) 5000 files on a
      fatfs USB device and the device is unplugged, many message occur, shown
      below.  This makes the application slow.  So use the new
      fat_msg_ratelimit() decrease the messaging rate.
      
        #> ./file_lookup_testcase ./files_directory/
        usb 2-1.4: USB disconnect, device number 4
        FAT-fs (sda1): FAT read failed (blocknr 2631)
        FAT-fs (sda1): Directory bread(block 396816) failed
        FAT-fs (sda1): Directory bread(block 396817) failed
        FAT-fs (sda1): Directory bread(block 396818) failed
        FAT-fs (sda1): Directory bread(block 396819) failed
        FAT-fs (sda1): Directory bread(block 396820) failed
        FAT-fs (sda1): Directory bread(block 396821) failed
        FAT-fs (sda1): Directory bread(block 396822) failed
        FAT-fs (sda1): Directory bread(block 396823) failed
        FAT-fs (sda1): Directory bread(block 406824) failed
        FAT-fs (sda1): Directory bread(block 406825) failed
        FAT-fs (sda1): Directory bread(block 406826) failed
        FAT-fs (sda1): Directory bread(block 406827) failed
        FAT-fs (sda1): Directory bread(block 406828) failed
        FAT-fs (sda1): Directory bread(block 406829) failed
        FAT-fs (sda1): Directory bread(block 406830) failed
        FAT-fs (sda1): Directory bread(block 406831) failed
        FAT-fs (sda1): Directory bread(block 417696) failed
        FAT-fs (sda1): Directory bread(block 417697) failed
        FAT-fs (sda1): Directory bread(block 417698) failed
        FAT-fs (sda1): Directory bread(block 417699) failed
        FAT-fs (sda1): Directory bread(block 417700) failed
        FAT-fs (sda1): Directory bread(block 417701) failed
        FAT-fs (sda1): Directory bread(block 417702) failed
        FAT-fs (sda1): Directory bread(block 417703) failed
        FAT-fs (sda1): FAT read failed (blocknr 2631)
        FAT-fs (sda1): Directory bread(block 396816) failed
        FAT-fs (sda1): Directory bread(block 396817) failed
        FAT-fs (sda1): Directory bread(block 396818) failed
        FAT-fs (sda1): Directory bread(block 396819) failed
        FAT-fs (sda1): Directory bread(block 396820) failed
        FAT-fs (sda1): Directory bread(block 396821) failed
      Signed-off-by: NNamjae Jeon <linkinjeon@gmail.com>
      Signed-off-by: NAmit Sahrawat <amit.sahrawat83@gmail.com>
      Acked-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f0aac616
  2. 01 11月, 2011 1 次提交
  3. 17 8月, 2011 1 次提交
  4. 12 4月, 2011 1 次提交
  5. 17 5月, 2010 1 次提交
  6. 16 3月, 2010 1 次提交
  7. 13 7月, 2009 1 次提交
  8. 16 6月, 2009 1 次提交
    • A
      NLS: update handling of Unicode · 74675a58
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      74675a58
  9. 12 6月, 2009 1 次提交
  10. 04 6月, 2009 1 次提交
  11. 12 11月, 2008 1 次提交
  12. 07 11月, 2008 6 次提交
  13. 23 10月, 2008 1 次提交
  14. 26 7月, 2008 5 次提交
  15. 21 6月, 2008 1 次提交
    • L
      Replace BKL with superblock lock in fat/msdos/vfat · 8f593427
      Linus Torvalds 提交于
      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: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      8f593427
  16. 28 4月, 2008 2 次提交
  17. 17 7月, 2007 1 次提交
  18. 09 5月, 2007 1 次提交
    • O
      fat: fix VFAT compat ioctls on 64-bit systems · c483bab0
      OGAWA Hirofumi 提交于
      If you compile and run the below test case in an msdos or vfat directory on
      an x86-64 system with -m32 you'll get garbage in the kernel_dirent struct
      followed by a SIGSEGV.
      
      The patch fixes this.
      
      Reported and initial fix by Bart Oldeman
      
      #include <sys/types.h>
      #include <sys/ioctl.h>
      #include <dirent.h>
      #include <stdio.h>
      #include <unistd.h>
      #include <fcntl.h>
      struct kernel_dirent {
               long            d_ino;
               long		d_off;
               unsigned short  d_reclen;
               char            d_name[256]; /* We must not include limits.h! */
      };
      #define VFAT_IOCTL_READDIR_BOTH  _IOR('r', 1, struct kernel_dirent [2])
      #define VFAT_IOCTL_READDIR_SHORT  _IOR('r', 2, struct kernel_dirent [2])
      
      int main(void)
      {
               int fd = open(".", O_RDONLY);
               struct kernel_dirent de[2];
      
               while (1) {
                       int i = ioctl(fd, VFAT_IOCTL_READDIR_BOTH, (long)de);
                       if (i == -1) break;
                       if (de[0].d_reclen == 0) break;
                       printf("SFN: reclen=%2d off=%d ino=%d, %-12s",
       		       de[0].d_reclen, de[0].d_off, de[0].d_ino, de[0].d_name);
       		if (de[1].d_reclen)
       		  printf("\tLFN: reclen=%2d off=%d ino=%d, %s",
       		    de[1].d_reclen, de[1].d_off, de[1].d_ino, de[1].d_name);
       		printf("\n");
               }
               return 0;
      }
      Signed-off-by: NBart Oldeman <bartoldeman@users.sourceforge.net>
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c483bab0
  19. 09 12月, 2006 1 次提交
  20. 03 10月, 2006 1 次提交
    • D
      [PATCH] VFS: Make filldir_t and struct kstat deal in 64-bit inode numbers · afefdbb2
      David Howells 提交于
      These patches make the kernel pass 64-bit inode numbers internally when
      communicating to userspace, even on a 32-bit system.  They are required
      because some filesystems have intrinsic 64-bit inode numbers: NFS3+ and XFS
      for example.  The 64-bit inode numbers are then propagated to userspace
      automatically where the arch supports it.
      
      Problems have been seen with userspace (eg: ld.so) using the 64-bit inode
      number returned by stat64() or getdents64() to differentiate files, and
      failing because the 64-bit inode number space was compressed to 32-bits, and
      so overlaps occur.
      
      This patch:
      
      Make filldir_t take a 64-bit inode number and struct kstat carry a 64-bit
      inode number so that 64-bit inode numbers can be passed back to userspace.
      
      The stat functions then returns the full 64-bit inode number where
      available and where possible.  If it is not possible to represent the inode
      number supplied by the filesystem in the field provided by userspace, then
      error EOVERFLOW will be issued.
      
      Similarly, the getdents/readdir functions now pass the full 64-bit inode
      number to userspace where possible, returning EOVERFLOW instead when a
      directory entry is encountered that can't be properly represented.
      
      Note that this means that some inodes will not be stat'able on a 32-bit
      system with old libraries where they were before - but it does mean that
      there will be no ambiguity over what a 32-bit inode number refers to.
      
      Note similarly that directory scans may be cut short with an error on a
      32-bit system with old libraries where the scan would work before for the
      same reasons.
      
      It is judged unlikely that this situation will occur because modern glibc
      uses 64-bit capable versions of stat and getdents class functions
      exclusively, and that older systems are unlikely to encounter
      unrepresentable inode numbers anyway.
      
      [akpm: alpha build fix]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      afefdbb2
  21. 01 10月, 2006 1 次提交
  22. 29 3月, 2006 1 次提交
  23. 22 3月, 2006 1 次提交
  24. 10 1月, 2006 1 次提交
  25. 09 1月, 2006 3 次提交
  26. 31 10月, 2005 2 次提交
  27. 08 9月, 2005 1 次提交
    • K
      [PATCH] Speedup FAT filesystem directory reads · f3ef6f63
      Karsten Wiese 提交于
            OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      
      This speeds up directory reads for large FAT partitions, if the buffercache
      has to be filled from the drive. Following values were taken from:
      
              $ time find path_to_freshly_mounted_fat > /dev/null
      
      on an otherwise idle system.
      
      FAT with 16KB Clusters on IDE attached drive:   Factor  2
      FAT with 32KB Clusters on USB2 attached drive:  Factor 10 (!)
      Its less than 1/10 slower, if the buffercache is uptodate.
      
      The patch introduces the new function fat_dir_readahead().
      
      fat_dir_readahead() calls sb_breadahead() to readahead a whole cluster,
      if the requested sector is the first one in a cluster.
      It is usefull to do this, because on FAT directories occupy whole
      clusters, with the exception of FAT12/FAT16 root dirs.
      
      Readahead is only done, if the cluster's first sector is not uptodate
      to avoid overhead, when the buffer cache is already uptodate.
      Note that under memory pressure, the maximal byte count wasted
      (read: has to be red from disk twice) is 1 cluster's size.  Thats 64KB.
      
      fat_dir_readahead() is called from fat__get_entry().
      
      There is also an unrelated cleanup at one spot:
      
              if (bh)
                      brelse(bh);
      
      is replaced with:
      
              brelse(bh);
      
      brelse() can handle NULL pointer arguments by itself.
      Signed-off-by: NKarsten Wiese <annabellesgarden@yahoo.de>
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f3ef6f63