1. 09 1月, 2012 5 次提交
    • A
      btrfs: make open_ctree() return int · ad2b2c80
      Al Viro 提交于
      It returns either ERR_PTR(-ve) or sb->s_fs_info.  The latter can
      be found by caller just as well, TYVM, no need to return it.  Just
      return -ve or 0...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ad2b2c80
    • A
      btrfs: sanitizing ->fs_info, part 4 · 6f07e42e
      Al Viro 提交于
      A new helper: btrfs_alloc_root(fs_info); allocates btrfs_root
      and sets ->fs_info.  All places allocating the suckers converted
      to it.  At that point we *never* reassign ->fs_info of btrfs_root;
      it's set before anyone sees the address of newly allocated
      struct btrfs_root and never assigned anywhere else.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6f07e42e
    • A
      btrfs: fix mount/umount race · 6de1d09d
      Al Viro 提交于
      Do *NOT* skip doomed superblocks in btrfs_test_super(); we want
      sget() to wait for their shutdown to complete.  Since we don't
      mutilate ->s_fs_info in ->put_super() anymore (or free what it
      used to point to until the superblock is past being findable
      by sget()), we can just DTRT there and report a match.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6de1d09d
    • A
      btrfs: get ->kill_sb() of its own · aea52e19
      Al Viro 提交于
      ... and move free_fs_info() to that, out of ->put_super().  Do NOT
      set ->s_fs_info to NULL in the latter; we need it for sget() to
      be able to see and wait for fs in the middle of umount if we get a
      mount/umount race.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      aea52e19
    • A
      btrfs: preparation to fixing mount/umount race · 98c7089c
      Al Viro 提交于
      We need fs_info and root to live until the moment when the victim
      superblock leaves the list, so we need to postpone free_fs_info()
      until after ->put_super().  The call is buried in close_ctree(),
      though, so we need to lift it into the callers (including
      btrfs_put_super()) first.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      98c7089c
  2. 07 1月, 2012 1 次提交
  3. 04 1月, 2012 1 次提交
  4. 16 12月, 2011 1 次提交
    • J
      Btrfs: deal with enospc from dirtying inodes properly · 22c44fe6
      Josef Bacik 提交于
      Now that we're properly keeping track of delayed inode space we've been getting
      a lot of warnings out of btrfs_dirty_inode() when running xfstest 83.  This is
      because a bunch of people call mark_inode_dirty, which is void so we can't
      return ENOSPC.  This needs to be fixed in a few areas
      
      1) file_update_time - this updates the mtime and such when writing to a file,
      which will call mark_inode_dirty.  So copy file_update_time into btrfs so we can
      call btrfs_dirty_inode directly and return an error if we get one appropriately.
      
      2) fix symlinks to use btrfs_setattr for ->setattr.  For some reason we weren't
      setting ->setattr for symlinks, even though we should have been.  This catches
      one of the cases where we were getting errors in mark_inode_dirty.
      
      3) Fix btrfs_setattr and btrfs_setsize to call btrfs_dirty_inode directly
      instead of mark_inode_dirty.  This lets us return errors properly for truncate
      and chown/anything related to setattr.
      
      4) Add a new btrfs_fs_dirty_inode which will just call btrfs_dirty_inode and
      print an error if we have one.  The only remaining user we can't control for
      this is touch_atime(), but we don't really want to keep people from walking
      down the tree if we don't have space to save the atime update, so just complain
      but don't worry about it.
      
      With this patch xfstests 83 complains a handful of times instead of hundreds of
      times.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      22c44fe6
  5. 15 12月, 2011 1 次提交
  6. 01 12月, 2011 1 次提交
    • L
      Btrfs: fix oops when calling statfs on readonly device · b772a86e
      Li Zefan 提交于
      To reproduce this bug:
      
        # dd if=/dev/zero of=img bs=1M count=256
        # mkfs.btrfs img
        # losetup -r /dev/loop1 img
        # mount /dev/loop1 /mnt
        OOPS!!
      
      It triggered BUG_ON(!nr_devices) in btrfs_calc_avail_data_space().
      
      To fix this, instead of checking write-only devices, we check all open
      deivces:
      
        # df -h /dev/loop1
        Filesystem            Size  Used Avail Use% Mounted on
        /dev/loop1            250M   28K  238M   1% /mnt
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      b772a86e
  7. 17 11月, 2011 3 次提交
  8. 11 11月, 2011 1 次提交
  9. 10 11月, 2011 3 次提交
  10. 08 11月, 2011 1 次提交
    • S
      btrfs: fix double-free 'tree_root' in 'btrfs_mount()' · 45ea6095
      slyich@gmail.com 提交于
      On error path 'tree_root' is treed in 'free_fs_info()'.
      No need to free it explicitely. Noticed by SLUB in debug mode:
      
      Complete reproducer under usermode linux (discovered on real
      machine):
      
          bdev=/dev/ubda
          btr_root=/btr
          /mkfs.btrfs $bdev
          mount $bdev $btr_root
          mkdir $btr_root/subvols/
          cd $btr_root/subvols/
          /btrfs su cr foo
          /btrfs su cr bar
          mount $bdev -osubvol=subvols/foo $btr_root/subvols/bar
          umount $btr_root/subvols/bar
      
      which gives
      
      device fsid 4d55aa28-45b1-474b-b4ec-da912322195e devid 1 transid 7 /dev/ubda
      =============================================================================
      BUG kmalloc-2048: Object already free
      -----------------------------------------------------------------------------
      
      INFO: Allocated in btrfs_mount+0x389/0x7f0 age=0 cpu=0 pid=277
      INFO: Freed in btrfs_mount+0x51c/0x7f0 age=0 cpu=0 pid=277
      INFO: Slab 0x0000000062886200 objects=15 used=9 fp=0x0000000070b4d2d0 flags=0x4081
      INFO: Object 0x0000000070b4d2d0 @offset=21200 fp=0x0000000070b4a968
      ...
      Call Trace:
      70b31948:  [<6008c522>] print_trailer+0xe2/0x130
      70b31978:  [<6008c5aa>] object_err+0x3a/0x50
      70b319a8:  [<6008e242>] free_debug_processing+0x142/0x2a0
      70b319e0:  [<600ebf6f>] btrfs_mount+0x55f/0x7f0
      70b319f8:  [<6008e5c1>] __slab_free+0x221/0x2d0
      Signed-off-by: NSergei Trofimovich <slyfox@gentoo.org>
      Cc: Arne Jansen <sensille@gmx.net>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: David Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      45ea6095
  11. 06 11月, 2011 2 次提交
    • C
      Btrfs: add a log of past tree roots · af31f5e5
      Chris Mason 提交于
      This takes some of the free space in the btrfs super block
      to record information about most of the roots in the last four
      commits.
      
      It also adds a -o recovery to use the root history log when
      we're not able to read the tree of tree roots, the extent
      tree root, the device tree root or the csum root.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      af31f5e5
    • D
      btrfs: separate superblock items out of fs_info · 6c41761f
      David Sterba 提交于
      fs_info has now ~9kb, more than fits into one page. This will cause
      mount failure when memory is too fragmented. Top space consumers are
      super block structures super_copy and super_for_commit, ~2.8kb each.
      Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64)
      
      Add a wrapper for freeing fs_info and all of it's dynamically allocated
      members.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      6c41761f
  12. 24 10月, 2011 1 次提交
    • D
      btrfs: do not allow mounting non-subvolumes via subvol option · f9d9ef62
      David Sterba 提交于
      There's a missing test whether the path passed to subvol=path option
      during mount is a real subvolume, allowing any directory located in
      default subovlume to be passed and accepted for mount.
      
      (current btrfs progs prevent this early)
      $ btrfs subvol snapshot . p1-snap
      ERROR: '.' is not a subvolume
      
      (with "is subvolume?" test bypassed)
      $ btrfs subvol snapshot . p1-snap
      Create a snapshot of '.' in './p1-snap'
      
      $ btrfs subvol list -p .
      ID 258 parent 5 top level 5 path subvol
      ID 259 parent 5 top level 5 path subvol1
      ID 260 parent 5 top level 5 path default-subvol1
      ID 262 parent 5 top level 5 path p1/p1-snapshot
      ID 263 parent 259 top level 5 path subvol1/subvol1-snap
      
      The problem I see is that this makes a false impression of snapshotting the
      given subvolume but in fact snapshots the default one: a user expects outcome
      like ID 263 but in fact gets ID 262 .
      
      This patch makes mount fail with EINVAL with a message in syslog.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      f9d9ef62
  13. 21 10月, 2011 2 次提交
  14. 20 10月, 2011 3 次提交
    • J
      Btrfs: introduce mount option no_space_cache · 73bc1876
      Josef Bacik 提交于
      Some users have requested this and I've found I needed a way to disable cache
      loading without actually clearing the cache, so introduce the no_space_cache
      option.  Before we check the super blocks cache generation field and if it was
      populated we always turned space caching on.  Now we check this and set the
      space cache option on, and then parse the mount options so that if we want it
      off it get's turned off.  Then we check the mount option all the places we do
      the caching work instead of checking the super's cache generation.  This makes
      things more consistent and lets us turn space caching off.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      73bc1876
    • J
      Btrfs: fix how we mount subvol=<whatever> · 830c4adb
      Josef Bacik 提交于
      We've only been able to mount with subvol=<whatever> where whatever was a subvol
      within whatever root we had as the default.  This allows us to mount -o
      subvol=path/to/subvol/you/want relative from the normal fs_tree root.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      830c4adb
    • J
      Btrfs: use d_obtain_alias when mounting subvol/subvolid · ba5b8958
      Josef Bacik 提交于
      Currently what we do is just wrong.  We either
      
      1) Alloc a new "root" dentry with sb->s_root as it's parent which is just wrong
      as we could walk into this subvol later on via another path and hilarity could
      ensue.  Also we don't check the return value of d_splice_alias which isn't good
      either.
      
      or
      
      2) Do a d_find_alias() which we could have lost our dentry from cache at this
      point and found nothing.
      
      So use d_obtain_alias().  In the case that we already have the inode/dentry in
      cache we will get the correct dentry.  If not we will get a disconnected dentry
      tree so if we walk into it later on everything will be connected up properly.
      Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      ba5b8958
  15. 07 7月, 2011 1 次提交
  16. 04 6月, 2011 2 次提交
    • C
      Btrfs: add mount -o inode_cache · 4b9465cb
      Chris Mason 提交于
      This makes the inode map cache default to off until we
      fix the overflow problem when the free space crcs don't fit
      inside a single page.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      4b9465cb
    • A
      more conservative S_NOSEC handling · 9e1f1de0
      Al Viro 提交于
      Caching "we have already removed suid/caps" was overenthusiastic as merged.
      On network filesystems we might have had suid/caps set on another client,
      silently picked by this client on revalidate, all of that *without* clearing
      the S_NOSEC flag.
      
      AFAICS, the only reasonably sane way to deal with that is
      	* new superblock flag; unless set, S_NOSEC is not going to be set.
      	* local block filesystems set it in their ->mount() (more accurately,
      mount_bdev() does, so does btrfs ->mount(), users of mount_bdev() other than
      local block ones clear it)
      	* if any network filesystem (or a cluster one) wants to use S_NOSEC,
      it'll need to set MS_NOSEC in sb->s_flags *AND* take care to clear S_NOSEC when
      inode attribute changes are picked from other clients.
      
      It's not an earth-shattering hole (anybody that can set suid on another client
      will almost certainly be able to write to the file before doing that anyway),
      but it's a bug that needs fixing.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9e1f1de0
  17. 27 5月, 2011 2 次提交
    • C
      Btrfs: add mount -o auto_defrag · 4cb5300b
      Chris Mason 提交于
      This will detect small random writes into files and
      queue the up for an auto defrag process.  It isn't well suited to
      database workloads yet, but works for smaller files such as rpm, sqlite
      or bdb databases.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      4cb5300b
    • D
      btrfs: add cleancache support · 90a887c9
      Dan Magenheimer 提交于
      This sixth patch of eight in this cleancache series "opts-in"
      cleancache for btrfs.  Filesystems must explicitly enable
      cleancache by calling cleancache_init_fs anytime an instance
      of the filesystem is mounted.  Btrfs uses its own readpage
      which must be hooked, but all other cleancache hooks are in
      the VFS layer including the matching cleancache_flush_fs hook
      which must be called on unmount.
      
      Details and a FAQ can be found in Documentation/vm/cleancache.txt
      
      [v6-v8: no changes]
      [v5: jeremy@goop.org: simplify init hook and any future fs init changes]
      Signed-off-by: NDan Magenheimer <dan.magenheimer@oracle.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      Reviewed-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Rik Van Riel <riel@redhat.com>
      Cc: Jan Beulich <JBeulich@novell.com>
      Cc: Andreas Dilger <adilger@sun.com>
      Cc: Ted Ts'o <tytso@mit.edu>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      90a887c9
  18. 24 5月, 2011 1 次提交
    • J
      fs/btrfs: Add missing btrfs_free_path · b0839166
      Julia Lawall 提交于
      Btrfs_alloc_path should be matched with btrfs_free_path in error-handling code.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression struct btrfs_path * x;
      expression ra,rb;
      position p1,p2;
      @@
      
      x = btrfs_alloc_path@p1(...)
      ...  when != btrfs_free_path(x,...)
           when != if (...) { ... btrfs_free_path(x,...) ...}
           when != x = ra
      if(...) { ... when != x = rb
           when forall
           when != btrfs_free_path(x,...)
       \(return <+...x...+>; \| return@p2...; \) }
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      cocci.print_main("alloc",p1)
      cocci.print_secs("return",p2)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      b0839166
  19. 21 5月, 2011 1 次提交
    • M
      btrfs: implement delayed inode items operation · 16cdcec7
      Miao Xie 提交于
      Changelog V5 -> V6:
      - Fix oom when the memory load is high, by storing the delayed nodes into the
        root's radix tree, and letting btrfs inodes go.
      
      Changelog V4 -> V5:
      - Fix the race on adding the delayed node to the inode, which is spotted by
        Chris Mason.
      - Merge Chris Mason's incremental patch into this patch.
      - Fix deadlock between readdir() and memory fault, which is reported by
        Itaru Kitayama.
      
      Changelog V3 -> V4:
      - Fix nested lock, which is reported by Itaru Kitayama, by updating space cache
        inode in time.
      
      Changelog V2 -> V3:
      - Fix the race between the delayed worker and the task which does delayed items
        balance, which is reported by Tsutomu Itoh.
      - Modify the patch address David Sterba's comment.
      - Fix the bug of the cpu recursion spinlock, reported by Chris Mason
      
      Changelog V1 -> V2:
      - break up the global rb-tree, use a list to manage the delayed nodes,
        which is created for every directory and file, and used to manage the
        delayed directory name index items and the delayed inode item.
      - introduce a worker to deal with the delayed nodes.
      
      Compare with Ext3/4, the performance of file creation and deletion on btrfs
      is very poor. the reason is that btrfs must do a lot of b+ tree insertions,
      such as inode item, directory name item, directory name index and so on.
      
      If we can do some delayed b+ tree insertion or deletion, we can improve the
      performance, so we made this patch which implemented delayed directory name
      index insertion/deletion and delayed inode update.
      
      Implementation:
      - introduce a delayed root object into the filesystem, that use two lists to
        manage the delayed nodes which are created for every file/directory.
        One is used to manage all the delayed nodes that have delayed items. And the
        other is used to manage the delayed nodes which is waiting to be dealt with
        by the work thread.
      - Every delayed node has two rb-tree, one is used to manage the directory name
        index which is going to be inserted into b+ tree, and the other is used to
        manage the directory name index which is going to be deleted from b+ tree.
      - introduce a worker to deal with the delayed operation. This worker is used
        to deal with the works of the delayed directory name index items insertion
        and deletion and the delayed inode update.
        When the delayed items is beyond the lower limit, we create works for some
        delayed nodes and insert them into the work queue of the worker, and then
        go back.
        When the delayed items is beyond the upper bound, we create works for all
        the delayed nodes that haven't been dealt with, and insert them into the work
        queue of the worker, and then wait for that the untreated items is below some
        threshold value.
      - When we want to insert a directory name index into b+ tree, we just add the
        information into the delayed inserting rb-tree.
        And then we check the number of the delayed items and do delayed items
        balance. (The balance policy is above.)
      - When we want to delete a directory name index from the b+ tree, we search it
        in the inserting rb-tree at first. If we look it up, just drop it. If not,
        add the key of it into the delayed deleting rb-tree.
        Similar to the delayed inserting rb-tree, we also check the number of the
        delayed items and do delayed items balance.
        (The same to inserting manipulation)
      - When we want to update the metadata of some inode, we cached the data of the
        inode into the delayed node. the worker will flush it into the b+ tree after
        dealing with the delayed insertion and deletion.
      - We will move the delayed node to the tail of the list after we access the
        delayed node, By this way, we can cache more delayed items and merge more
        inode updates.
      - If we want to commit transaction, we will deal with all the delayed node.
      - the delayed node will be freed when we free the btrfs inode.
      - Before we log the inode items, we commit all the directory name index items
        and the delayed inode update.
      
      I did a quick test by the benchmark tool[1] and found we can improve the
      performance of file creation by ~15%, and file deletion by ~20%.
      
      Before applying this patch:
      Create files:
              Total files: 50000
              Total time: 1.096108
              Average time: 0.000022
      Delete files:
              Total files: 50000
              Total time: 1.510403
              Average time: 0.000030
      
      After applying this patch:
      Create files:
              Total files: 50000
              Total time: 0.932899
              Average time: 0.000019
      Delete files:
              Total files: 50000
              Total time: 1.215732
              Average time: 0.000024
      
      [1] http://marc.info/?l=linux-btrfs&m=128212635122920&q=p3
      
      Many thanks for Kitayama-san's help!
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Reviewed-by: NDavid Sterba <dave@jikos.cz>
      Tested-by: NTsutomu Itoh <t-itoh@jp.fujitsu.com>
      Tested-by: NItaru Kitayama <kitayama@cl.bb4u.ne.jp>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      16cdcec7
  20. 13 5月, 2011 1 次提交
  21. 02 5月, 2011 1 次提交
  22. 12 4月, 2011 1 次提交
  23. 05 4月, 2011 1 次提交
    • T
      Btrfs: fix /proc/mounts info. · 200da64e
      Tsutomu Itoh 提交于
      Some mount options are not displayed by /proc/mounts.
      This patch displays the option such as compress_type by /proc/mounts.
      
      Ex.
        [before]
          $ mount | grep sdc2
          /dev/sdc2 on /test12 type btrfs (rw,space_cache,compress=lzo)
          $ cat /proc/mounts | grep sdc2
          /dev/sdc2 /test12 btrfs rw,relatime,compress 0 0
      
        [after]
          $ mount | grep sdc2
          /dev/sdc2 on /test12 type btrfs (rw,space_cache,compress=lzo)
          $ cat /proc/mounts | grep sdc2
          /dev/sdc2 /test12 btrfs rw,relatime,compress=lzo,space_cache 0 0
      Signed-off-by: NTsutomu Itoh <t-itoh@jp.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      200da64e
  24. 28 3月, 2011 1 次提交
    • L
      Btrfs: add initial tracepoint support for btrfs · 1abe9b8a
      liubo 提交于
      Tracepoints can provide insight into why btrfs hits bugs and be greatly
      helpful for debugging, e.g
                    dd-7822  [000]  2121.641088: btrfs_inode_request: root = 5(FS_TREE), gen = 4, ino = 256, blocks = 8, disk_i_size = 0, last_trans = 8, logged_trans = 0
                    dd-7822  [000]  2121.641100: btrfs_inode_new: root = 5(FS_TREE), gen = 8, ino = 257, blocks = 0, disk_i_size = 0, last_trans = 0, logged_trans = 0
       btrfs-transacti-7804  [001]  2146.935420: btrfs_cow_block: root = 2(EXTENT_TREE), refs = 2, orig_buf = 29368320 (orig_level = 0), cow_buf = 29388800 (cow_level = 0)
       btrfs-transacti-7804  [001]  2146.935473: btrfs_cow_block: root = 1(ROOT_TREE), refs = 2, orig_buf = 29364224 (orig_level = 0), cow_buf = 29392896 (cow_level = 0)
       btrfs-transacti-7804  [001]  2146.972221: btrfs_transaction_commit: root = 1(ROOT_TREE), gen = 8
         flush-btrfs-2-7821  [001]  2155.824210: btrfs_chunk_alloc: root = 3(CHUNK_TREE), offset = 1103101952, size = 1073741824, num_stripes = 1, sub_stripes = 0, type = DATA
         flush-btrfs-2-7821  [001]  2155.824241: btrfs_cow_block: root = 2(EXTENT_TREE), refs = 2, orig_buf = 29388800 (orig_level = 0), cow_buf = 29396992 (cow_level = 0)
         flush-btrfs-2-7821  [001]  2155.824255: btrfs_cow_block: root = 4(DEV_TREE), refs = 2, orig_buf = 29372416 (orig_level = 0), cow_buf = 29401088 (cow_level = 0)
         flush-btrfs-2-7821  [000]  2155.824329: btrfs_cow_block: root = 3(CHUNK_TREE), refs = 2, orig_buf = 20971520 (orig_level = 0), cow_buf = 20975616 (cow_level = 0)
       btrfs-endio-wri-7800  [001]  2155.898019: btrfs_cow_block: root = 5(FS_TREE), refs = 2, orig_buf = 29384704 (orig_level = 0), cow_buf = 29405184 (cow_level = 0)
       btrfs-endio-wri-7800  [001]  2155.898043: btrfs_cow_block: root = 7(CSUM_TREE), refs = 2, orig_buf = 29376512 (orig_level = 0), cow_buf = 29409280 (cow_level = 0)
      
      Here is what I have added:
      
      1) ordere_extent:
              btrfs_ordered_extent_add
              btrfs_ordered_extent_remove
              btrfs_ordered_extent_start
              btrfs_ordered_extent_put
      
      These provide critical information to understand how ordered_extents are
      updated.
      
      2) extent_map:
              btrfs_get_extent
      
      extent_map is used in both read and write cases, and it is useful for tracking
      how btrfs specific IO is running.
      
      3) writepage:
              __extent_writepage
              btrfs_writepage_end_io_hook
      
      Pages are cirtical resourses and produce a lot of corner cases during writeback,
      so it is valuable to know how page is written to disk.
      
      4) inode:
              btrfs_inode_new
              btrfs_inode_request
              btrfs_inode_evict
      
      These can show where and when a inode is created, when a inode is evicted.
      
      5) sync:
              btrfs_sync_file
              btrfs_sync_fs
      
      These show sync arguments.
      
      6) transaction:
              btrfs_transaction_commit
      
      In transaction based filesystem, it will be useful to know the generation and
      who does commit.
      
      7) back reference and cow:
      	btrfs_delayed_tree_ref
      	btrfs_delayed_data_ref
      	btrfs_delayed_ref_head
      	btrfs_cow_block
      
      Btrfs natively supports back references, these tracepoints are helpful on
      understanding btrfs's COW mechanism.
      
      8) chunk:
      	btrfs_chunk_alloc
      	btrfs_chunk_free
      
      Chunk is a link between physical offset and logical offset, and stands for space
      infomation in btrfs, and these are helpful on tracing space things.
      
      9) reserved_extent:
      	btrfs_reserved_extent_alloc
      	btrfs_reserved_extent_free
      
      These can show how btrfs uses its space.
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      1abe9b8a
  25. 17 2月, 2011 1 次提交
  26. 01 2月, 2011 1 次提交