1. 29 8月, 2013 1 次提交
    • Z
      ext4: isolate ext4_extents.h file · d7b2a00c
      Zheng Liu 提交于
      After applied the commit (4a092d73), we have reduced the number of
      source files that need to #include ext4_extents.h.  But we can do
      better.
      
      This commit defines ext4_zeroout_es() in extents.c and move
      EXT_MAX_BLOCKS into ext4.h in order not to include ext4_extents.h in
      indirect.c and ioctl.c.  Meanwhile we just need to include this file in
      extent_status.c when ES_AGGRESSIVE_TEST is defined.  Otherwise, this
      commit removes a duplicated declaration in trace/events/ext4.h.
      
      After applied this patch, we just need to include ext4_extents.h file
      in {super,migrate,move_extents,extents}.c, and it is easy for us to
      define a new extent disk layout.
      Signed-off-by: NZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      d7b2a00c
  2. 17 8月, 2013 1 次提交
    • T
      ext4: add support for extent pre-caching · 7869a4a6
      Theodore Ts'o 提交于
      Add a new fiemap flag which forces the all of the extents in an inode
      to be cached in the extent_status tree.  This is critically important
      when using AIO to a preallocated file, since if we need to read in
      blocks from the extent tree, the io_submit(2) system call becomes
      synchronous, and the AIO is no longer "A", which is bad.
      
      In addition, for most files which have an external leaf tree block,
      the cost of caching the information in the extent status tree will be
      less than caching the entire 4k block in the buffer cache.  So it is
      generally a win to keep the extent information cached.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      7869a4a6
  3. 12 8月, 2013 1 次提交
  4. 10 4月, 2013 1 次提交
  5. 09 4月, 2013 1 次提交
    • D
      ext4: implementation of a new ioctl called EXT4_IOC_SWAP_BOOT · 393d1d1d
      Dr. Tilmann Bubeck 提交于
      Add a new ioctl, EXT4_IOC_SWAP_BOOT which swaps i_blocks and
      associated attributes (like i_blocks, i_size, i_flags, ...) from the
      specified inode with inode EXT4_BOOT_LOADER_INO (#5). This is
      typically used to store a boot loader in a secure part of the
      filesystem, where it can't be changed by a normal user by accident.
      The data blocks of the previous boot loader will be associated with
      the given inode.
      
      This usercode program is a simple example of the usage:
      
      int main(int argc, char *argv[])
      {
        int fd;
        int err;
      
        if ( argc != 2 ) {
          printf("usage: ext4-swap-boot-inode FILE-TO-SWAP\n");
          exit(1);
        }
      
        fd = open(argv[1], O_WRONLY);
        if ( fd < 0 ) {
          perror("open");
          exit(1);
        }
      
        err = ioctl(fd, EXT4_IOC_SWAP_BOOT);
        if ( err < 0 ) {
          perror("ioctl");
          exit(1);
        }
      
        close(fd);
        exit(0);
      }
      
      [ Modified by Theodore Ts'o to fix a number of bugs in the original code.]
      Signed-off-by: NDr. Tilmann Bubeck <t.bubeck@reinform.de>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      393d1d1d
  6. 04 4月, 2013 1 次提交
    • T
      ext4: support simple conversion of extent-mapped inodes to use i_blocks · 996bb9fd
      Theodore Ts'o 提交于
      In order to make it simpler to test the code which support
      i_blocks/indirect-mapped inodes, support the conversion of inodes
      which are less than 12 blocks and which are contained in no more than
      a single extent.
      
      The primary intended use of this code is to converting freshly created
      zero-length files and empty directories.
      
      Note that the version of chattr in e2fsprogs 1.42.7 and earlier has a
      check that prevents the clearing of the extent flag.  A simple patch
      which allows "chattr -e <file>" to work will be checked into the
      e2fsprogs git repository.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      996bb9fd
  7. 23 2月, 2013 1 次提交
  8. 09 2月, 2013 1 次提交
    • T
      ext4: pass context information to jbd2__journal_start() · 9924a92a
      Theodore Ts'o 提交于
      So we can better understand what bits of ext4 are responsible for
      long-running jbd2 handles, use jbd2__journal_start() so we can pass
      context information for logging purposes.
      
      The recommended way for finding the longer-running handles is:
      
         T=/sys/kernel/debug/tracing
         EVENT=$T/events/jbd2/jbd2_handle_stats
         echo "interval > 5" > $EVENT/filter
         echo 1 > $EVENT/enable
      
         ./run-my-fs-benchmark
      
         cat $T/trace > /tmp/problem-handles
      
      This will list handles that were active for longer than 20ms.  Having
      longer-running handles is bad, because a commit started at the wrong
      time could stall for those 20+ milliseconds, which could delay an
      fsync() or an O_SYNC operation.  Here is an example line from the
      trace file describing a handle which lived on for 311 jiffies, or over
      1.2 seconds:
      
      postmark-2917  [000] ....   196.435786: jbd2_handle_stats: dev 254,32 
         tid 570 type 2 line_no 2541 interval 311 sync 0 requested_blocks 1
         dirtied_blocks 0
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      9924a92a
  9. 13 1月, 2013 1 次提交
  10. 27 9月, 2012 5 次提交
  11. 05 9月, 2012 1 次提交
  12. 23 7月, 2012 2 次提交
  13. 18 7月, 2012 1 次提交
  14. 08 6月, 2012 1 次提交
  15. 01 6月, 2012 1 次提交
  16. 30 4月, 2012 1 次提交
  17. 09 1月, 2012 1 次提交
  18. 05 1月, 2012 2 次提交
    • D
      ext4: add missing ext4_resize_end on error paths · 014a1770
      Djalal Harouni 提交于
      Online resize ioctls 'EXT4_IOC_GROUP_EXTEND' and 'EXT4_IOC_GROUP_ADD'
      call ext4_resize_begin() to check permissions and to set the
      EXT4_RESIZING bit lock, they do their work and they must finish with
      ext4_resize_end() which calls clear_bit_unlock() to unlock and to
      avoid -EBUSY errors for the next resize operations.
      
      This patch adds the missing ext4_resize_end() calls on error paths.
      
      Patch tested.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDjalal Harouni <tixxdz@opendz.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      014a1770
    • Y
      ext4: add new online resize interface · 19c5246d
      Yongqiang Yang 提交于
      This patch adds new online resize interface, whose input argument is a
      64-bit integer indicating how many blocks there are in the resized fs.
      
      In new resize impelmentation, all work like allocating group tables
      are done by kernel side, so the new resize interface can support
      flex_bg feature and prepares ground for suppoting resize with features
      like bigalloc and exclude bitmap. Besides these, user-space tools just
      passes in the new number of blocks.
      
      We delay initializing the bitmaps and inode tables of added groups if
      possible and add multi groups (a flex groups) each time, so new resize
      is very fast like mkfs.
      Signed-off-by: NYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      19c5246d
  19. 04 1月, 2012 2 次提交
  20. 22 12月, 2011 1 次提交
    • T
      ext4: remove unneeded file_remove_suid() from ext4_ioctl() · 22cdfca5
      Theodore Ts'o 提交于
      In the code to support EXT4_IOC_MOVE_EXT, ext4_ioctl calls
      file_remove_suid() after the call to ext4_move_extents() if any
      extents has been moved.  There are at least three things wrong with
      this.  First, file_remove_suid() should be called with i_mutex down,
      which is not here.  Second, it should be called before the donor file
      has been modified, to avoid a potential race condition.  Third, and
      most importantly, it's pointless, because ext4_file_extents() already
      checks if the donor file has the setuid or setgid bit set, and will
      return an error in that case.  So the first two objections don't
      really matter, since file_remove_suid() will never need to modify the
      inode in any case.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      22cdfca5
  21. 18 10月, 2011 1 次提交
  22. 09 10月, 2011 1 次提交
  23. 10 9月, 2011 1 次提交
  24. 27 7月, 2011 1 次提交
  25. 24 3月, 2011 1 次提交
  26. 21 3月, 2011 1 次提交
  27. 24 2月, 2011 2 次提交
  28. 20 11月, 2010 1 次提交
    • L
      ext4: Add EXT4_IOC_TRIM ioctl to handle batched discard · e681c047
      Lukas Czerner 提交于
      Filesystem independent ioctl was rejected as not common enough to be in
      core vfs ioctl. Since we still need to access to this functionality this
      commit adds ext4 specific ioctl EXT4_IOC_TRIM to dispatch
      ext4_trim_fs().
      
      It takes fstrim_range structure as an argument. fstrim_range is definec in
      the include/linux/fs.h and its definition is as follows.
      
      struct fstrim_range {
      	__u64 start;
      	__u64 len;
      	__u64 minlen;
      }
      
      start	- first Byte to trim
      len	- number of Bytes to trim from start
      minlen	- minimum extent length to trim, free extents shorter than this
        number of Bytes will be ignored. This will be rounded up to fs
        block size.
      
      After the FITRIM is done, the number of actually discarded Bytes is stored
      in fstrim_range.len to give the user better insight on how much storage
      space has been really released for wear-leveling.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      e681c047
  29. 17 5月, 2010 2 次提交
  30. 15 5月, 2010 1 次提交
  31. 04 3月, 2010 1 次提交