Skip to content
Snippets Groups Projects
  1. May 05, 2012
  2. Apr 28, 2012
  3. Apr 19, 2012
  4. Apr 13, 2012
  5. Mar 30, 2012
  6. Mar 29, 2012
    • Liu Bo's avatar
      Btrfs: update to the right index of defragment · e1f041e1
      Liu Bo authored
      
      When we use autodefrag, we forget to update the index which indicates
      the last page we've dirty.  And we'll set dirty flags on a same set of
      pages again and again.
      
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      e1f041e1
    • Liu Bo's avatar
      Btrfs: do not bother to defrag an extent if it is a big real extent · 66c26892
      Liu Bo authored
      
      $ mkfs.btrfs /dev/sdb7
      $ mount /dev/sdb7 /mnt/btrfs/ -oautodefrag
      $ dd if=/dev/zero of=/mnt/btrfs/foobar bs=4k count=10 oflag=direct 2>/dev/null
      $ filefrag -v /mnt/btrfs/foobar
      Filesystem type is: 9123683e
      File size of /mnt/btrfs/foobar is 40960 (10 blocks, blocksize 4096)
       ext logical physical expected length flags
         0       0     3072              10 eof
      /mnt/btrfs/foobar: 1 extent found
      
      Now we have a big real extent [0, 40960), but autodefrag will still defrag it.
      
      $ sync
      $ filefrag -v /mnt/btrfs/foobar
      Filesystem type is: 9123683e
      File size of /mnt/btrfs/foobar is 40960 (10 blocks, blocksize 4096)
       ext logical physical expected length flags
         0       0     3082              10 eof
      /mnt/btrfs/foobar: 1 extent found
      
      So if we already find a big real extent, we're ok about that, just skip it.
      
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      66c26892