)]}'
{
  "log": [
    {
      "commit": "b25b550bb153626df6a48eb8583e923e3dfcf64a",
      "tree": "baca9843877b8b3a254cde92ac2a9072014b5621",
      "parents": [
        "eda054770e5cd0e9ee1568dfcbcf39f9ade4f545",
        "6f902af400b2499c80865c62a06fbbd15cf804fd"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Fri Jun 11 14:18:47 2010 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Fri Jun 11 14:18:47 2010 -0700"
      },
      "message": "Merge branch \u0027for-linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* \u0027for-linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:\n  Btrfs: The file argument for fsync() is never null\n  Btrfs: handle ERR_PTR from posix_acl_from_xattr()\n  Btrfs: avoid BUG when dropping root and reference in same transaction\n  Btrfs: prohibit a operation of changing acl\u0027s mask when noacl mount option used\n  Btrfs: should add a permission check for setfacl\n  Btrfs: btrfs_lookup_dir_item() can return ERR_PTR\n  Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs\n  Btrfs: unwind after btrfs_start_transaction() errors\n  Btrfs: btrfs_iget() returns ERR_PTR\n  Btrfs: handle kzalloc() failure in open_ctree()\n  Btrfs: handle error returns from btrfs_lookup_dir_item()\n  Btrfs: Fix BUG_ON for fs converted from extN\n  Btrfs: Fix null dereference in relocation.c\n  Btrfs: fix remap_file_pages error\n  Btrfs: uninitialized data is check_path_shared()\n  Btrfs: fix fallocate regression\n  Btrfs: fix loop device on top of btrfs\n"
    },
    {
      "commit": "3bf84a5a834d13e7c5c3e8e5b5c6b26012118dd8",
      "tree": "7cc6e70cb2cc175163472141b1ca2dfc4c72eddd",
      "parents": [
        "046f264f6b3b2cf7e5a1769fc92335d8a9316282"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Mon May 31 09:04:46 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jun 11 15:48:35 2010 -0400"
      },
      "message": "Btrfs: Fix BUG_ON for fs converted from extN\n\nTree blocks can live in data block groups in FS converted from extN.\nSo it\u0027s easy to trigger the BUG_ON.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "105a048a4f35f7a74c7cc20b36dd83658b6ec232",
      "tree": "043b1110cda0042ba35d8aae59382bb094d0af3f",
      "parents": [
        "00b9b0af5887fed54e899e3b7f5c2ccf5e739def",
        "9aeead73782c4b8e2a91def36dbf95db28605c95"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu May 27 10:43:44 2010 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu May 27 10:43:44 2010 -0700"
      },
      "message": "Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (27 commits)\n  Btrfs: add more error checking to btrfs_dirty_inode\n  Btrfs: allow unaligned DIO\n  Btrfs: drop verbose enospc printk\n  Btrfs: Fix block generation verification race\n  Btrfs: fix preallocation and nodatacow checks in O_DIRECT\n  Btrfs: avoid ENOSPC errors in btrfs_dirty_inode\n  Btrfs: move O_DIRECT space reservation to btrfs_direct_IO\n  Btrfs: rework O_DIRECT enospc handling\n  Btrfs: use async helpers for DIO write checksumming\n  Btrfs: don\u0027t walk around with task-\u003estate !\u003d TASK_RUNNING\n  Btrfs: do aio_write instead of write\n  Btrfs: add basic DIO read/write support\n  direct-io: do not merge logically non-contiguous requests\n  direct-io: add a hook for the fs to provide its own submit_bio function\n  fs: allow short direct-io reads to be completed via buffered IO\n  Btrfs: Metadata ENOSPC handling for balance\n  Btrfs: Pre-allocate space for data relocation\n  Btrfs: Metadata ENOSPC handling for tree log\n  Btrfs: Metadata reservation for orphan inodes\n  Btrfs: Introduce global metadata reservation\n  ...\n"
    },
    {
      "commit": "933b585f70d524f1b6f0f6867bedb11d3dd82d3b",
      "tree": "f871988129967de5dabb20ae612ea7c22cc4c770",
      "parents": [
        "5bdd3536cbbe2ecd94ecc14410c6b1b31da16381"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed May 26 11:31:00 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed May 26 21:35:34 2010 -0400"
      },
      "message": "Btrfs: drop verbose enospc printk\n\nLess printk is good printk.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "3fd0a5585eb98e074fb9934549c8d85c49756c0d",
      "tree": "3e7ff9bd9678a5eea62818a2f4a50e19dda91a81",
      "parents": [
        "efa56464562991b8c24f965199888806bd8c4b38"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:49:59 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:54 2010 -0400"
      },
      "message": "Btrfs: Metadata ENOSPC handling for balance\n\nThis patch adds metadata ENOSPC handling for the balance code.\nIt is consisted by following major changes:\n\n1. Avoid COW tree leave in the phrase of merging tree.\n\n2. Handle interaction with snapshot creation.\n\n3. make the backref cache can live across transactions.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "d68fc57b7e3245cfacf2e3b47acfed1946a11786",
      "tree": "c2572fcd935017440c8370c8a12ceb49a7fc4f1f",
      "parents": [
        "8929ecfa50f266163832eeacfbc3642ed5eb83b6"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:49:58 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:52 2010 -0400"
      },
      "message": "Btrfs: Metadata reservation for orphan inodes\n\nreserve metadata space for handling orphan inodes\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "8929ecfa50f266163832eeacfbc3642ed5eb83b6",
      "tree": "e0177748af36d49d5f652cff0e421a8268cf7194",
      "parents": [
        "0ca1f7ceb1991099ed5273885ebcf4323948c72e"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:49:58 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:52 2010 -0400"
      },
      "message": "Btrfs: Introduce global metadata reservation\n\nReserve metadata space for extent tree, checksum tree and root tree\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "0ca1f7ceb1991099ed5273885ebcf4323948c72e",
      "tree": "10758d6a55c529aced177da3f6bf45cf26361913",
      "parents": [
        "a22285a6a32390195235171b89d157ed1a1fe932"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:48:47 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:51 2010 -0400"
      },
      "message": "Btrfs: Update metadata reservation for delayed allocation\n\nIntroduce metadata reservation context for delayed allocation\nand update various related functions.\n\nThis patch also introduces EXTENT_FIRST_DELALLOC control bit for\nset/clear_extent_bit. It tells set/clear_bit_hook whether they\nare processing the first extent_state with EXTENT_DELALLOC bit\nset. This change is important if set/clear_extent_bit involves\nmultiple extent_state.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "a22285a6a32390195235171b89d157ed1a1fe932",
      "tree": "3fabc88a029e1af4f2fdcc708e7b62ef3cf3703a",
      "parents": [
        "f0486c68e4bd9a06a5904d3eeb3a0d73a83befb8"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:48:46 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:50 2010 -0400"
      },
      "message": "Btrfs: Integrate metadata reservation with start_transaction\n\nBesides simplify the code, this change makes sure all metadata\nreservation for normal metadata operations are released after\ncommitting transaction.\n\nChanges since V1:\n\nAdd code that check if unlink and rmdir will free space.\n\nAdd ENOSPC handling for clone ioctl.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "f0486c68e4bd9a06a5904d3eeb3a0d73a83befb8",
      "tree": "509428ef400ef45e875a3c448b63b86cbea36aea",
      "parents": [
        "2ead6ae770d9f9dec9f4286bf0fd9001b4388c4b"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:46:25 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:50 2010 -0400"
      },
      "message": "Btrfs: Introduce contexts for metadata reservation\n\nIntroducing metadata reseravtion contexts has two major advantages.\nFirst, it makes metadata reseravtion more traceable. Second, it can\nreclaim freed space and re-add them to the itself after transaction\ncommitted.\n\nBesides add btrfs_block_rsv structure and related helper functions,\nThis patch contains following changes:\n\nMove code that decides if freed tree block should be pinned into\nbtrfs_free_tree_block().\n\nMake space accounting more accurate, mainly for handling read only\nblock groups.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "5da9d01b66458b180a6bee0e637a1d0a3effc622",
      "tree": "47eca61c0ad07ddc791cb7677c548d663fbac818",
      "parents": [
        "424499dbd0c4d88742bf581b5714b27fb44b9fef"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:46:25 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:48 2010 -0400"
      },
      "message": "Btrfs: Shrink delay allocated space in a synchronized\n\nShrink delayed allocation space in a synchronized manner is more\ncontrollable than flushing all delay allocated space in an async\nthread.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "424499dbd0c4d88742bf581b5714b27fb44b9fef",
      "tree": "f46a76c8f23c7045b18b31a9206d0b22f324aad1",
      "parents": [
        "b742bb82f1676d50103ade0ba89bfb79debabe73"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:46:25 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:48 2010 -0400"
      },
      "message": "Btrfs: Kill allocate_wait in space_info\n\nWe already have fs_info-\u003echunk_mutex to avoid concurrent\nchunk creation.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "b742bb82f1676d50103ade0ba89bfb79debabe73",
      "tree": "ceac53988a3c158571fb91d54e3027403363fb47",
      "parents": [
        "e40152ee1e1c7a63f4777791863215e3faa37a86"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sun May 16 10:46:24 2010 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue May 25 10:34:47 2010 -0400"
      },
      "message": "Btrfs: Link block groups of different raid types\n\nThe size of reserved space is stored in space_info. If block groups\nof different raid types are linked to separate space_info, changing\nallocation profile will corrupt reserved space accounting.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "fbd9b09a177a481eda256447c881f014f29034fe",
      "tree": "ef7e213045382f82a1e3e3cf134d196a1045dd7a",
      "parents": [
        "6b4517a7913a09d3259bb1d21c9cb300f12294bd"
      ],
      "author": {
        "name": "Dmitry Monakhov",
        "email": "dmonakhov@openvz.org",
        "time": "Wed Apr 28 17:55:06 2010 +0400"
      },
      "committer": {
        "name": "Jens Axboe",
        "email": "jens.axboe@oracle.com",
        "time": "Wed Apr 28 19:47:36 2010 +0200"
      },
      "message": "blkdev: generalize flags for blkdev_issue_fn functions\n\nThe patch just convert all blkdev_issue_xxx function to common\nset of flags. Wait/allocation semantics preserved.\n\nSigned-off-by: Dmitry Monakhov \u003cdmonakhov@openvz.org\u003e\nSigned-off-by: Jens Axboe \u003cjens.axboe@oracle.com\u003e\n"
    },
    {
      "commit": "d6cf853d4d73c268fc8920ac4e812ee26a12847c",
      "tree": "c909145638eb5c4897ea7e424759eb9b564ebe18",
      "parents": [
        "6a945f38be5f2c198853069a336c887a51d1a238",
        "9f680ce04ea19dabbbafe01b57b61930a9b70741"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Apr 12 18:37:04 2010 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Apr 12 18:37:04 2010 -0700"
      },
      "message": "Merge branch \u0027master\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* \u0027master\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:\n  Btrfs: make sure the chunk allocator doesn\u0027t create zero length chunks\n  Btrfs: fix data enospc check overflow\n"
    },
    {
      "commit": "795d580baec0d5386b83a8b557df47c20810e86b",
      "tree": "d0387c37562e9e27a4f43cf7ae425319cbdad359",
      "parents": [
        "449cedf099b23a250e7d61982e35555ccb871182",
        "109f6aef5fc436f355ad027f4d97bd696df2049a"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Apr 05 13:21:15 2010 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Apr 05 13:21:15 2010 -0700"
      },
      "message": "Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:\n  Btrfs: add check for changed leaves in setup_leaf_for_split\n  Btrfs: create snapshot references in same commit as snapshot\n  Btrfs: fix small race with delalloc flushing waitqueue\u0027s\n  Btrfs: use add_to_page_cache_lru, use __page_cache_alloc\n  Btrfs: fix chunk allocate size calculation\n  Btrfs: kill max_extent mount option\n  Btrfs: fail to mount if we have problems reading the block groups\n  Btrfs: check btrfs_get_extent return for IS_ERR()\n  Btrfs: handle kmalloc() failure in inode lookup ioctl\n  Btrfs: dereferencing freed memory\n  Btrfs: Simplify num_stripes\u0027s calculation logical for __btrfs_alloc_chunk()\n  Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()\n  Btrfs: Remove unnecessary finish_wait() in wait_current_trans()\n  Btrfs: add NULL check for do_walk_down()\n  Btrfs: remove duplicate include in ioctl.c\n\nFix trivial conflict in fs/btrfs/compression.c due to slab.h include\ncleanups.\n"
    },
    {
      "commit": "ab6e24103cbd215e922938a4f58c75194761a60e",
      "tree": "d54479feddd7fe625888dd62084621d4d0871c4b",
      "parents": [
        "109f6aef5fc436f355ad027f4d97bd696df2049a"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Mar 19 14:38:13 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Apr 05 16:04:50 2010 -0400"
      },
      "message": "Btrfs: fix data enospc check overflow\n\nBecause we account for reserved space we get from the allocator before we\nactually account for allocating delalloc space, we can have a small window where\nthe amount of \"used\" space in a space_info is more than the total amount of\nspace in the space_info.  This will cause a overflow in our check, so it will\nseem like we have _tons_ of free space, and we\u0027ll allow reservations to occur\nthat will end up larger than the amount of space we have.  I\u0027ve seen users\nreport ENOSPC panic\u0027s in cow_file_range a few times recently, so I tried to\nreproduce this problem and found I could reproduce it if I ran one of my tests\nin a loop for like 20 minutes.  With this patch my test ran all night without\nissues.  Thanks,\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "b5cb160084fad438c513d0952849e597ffe9e3d9",
      "tree": "91a5a1352cc803695b2ae3b3217c82d423ca5edf",
      "parents": [
        "28ecb60906e86e74e9ad4ac7e0218d8631e73a94"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Mar 12 19:28:18 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Apr 05 14:42:00 2010 -0400"
      },
      "message": "Btrfs: fix small race with delalloc flushing waitqueue\u0027s\n\nEverytime we start a new flushing thread, we init the waitqueue if there isn\u0027t a\nflushing thread running.  The problem with this is we check\nspace_info-\u003eflushing, which we clear right before doing a wake_up on the\nflushing waitqueue, which causes problems if we init the waitqueue in the middle\nof clearing the flushing flagh and calling wake_up.  This is hard to hit, but\nthe code is wrong anyway, so init the flushing/allocating waitqueue when\ncreating the space info and let it be.  I haven\u0027t seen the panic since I\u0027ve been\nusing this patch.  Thanks,\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "287a0ab91d25ca982f895a76402e5893b47ed7a6",
      "tree": "fcbe35daef2b4cbdc2bfc0c6026e7c45faef0245",
      "parents": [
        "1b1d1f6625e517a08640ddb4b8f8a0e025243fe3"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Mar 19 18:07:23 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 30 21:19:09 2010 -0400"
      },
      "message": "Btrfs: kill max_extent mount option\n\nAs Yan pointed out, theres not much reason for all this complicated math to\naccount for file extents being split up into max_extent chunks, since they are\nlikely to all end up in the same leaf anyway.  Since there isn\u0027t much reason to\nuse max_extent, just remove the option altogether so we have one less thing we\nneed to test.\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "1b1d1f6625e517a08640ddb4b8f8a0e025243fe3",
      "tree": "d662fe7e7d9ddec1214982b3dcd955228e18562f",
      "parents": [
        "6cf8bfbf5e88edfb09a2bf0631a067060f534592"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Mar 19 20:49:55 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 30 21:19:09 2010 -0400"
      },
      "message": "Btrfs: fail to mount if we have problems reading the block groups\n\nWe don\u0027t actually check the return value of btrfs_read_block_groups, so we can\npossibly succeed to mount, but then fail to say read the superblock xattr for\nselinux which will cause the vfs code to deactivate the super.\n\nThis is a problem because in find_free_extent we just assume that we\nwill find the right space_info for the allocation we want.  But if we\nfailed to read the block groups, we won\u0027t have setup any space_info\u0027s,\nand we\u0027ll hit a NULL pointer deref in find_free_extent.\n\nThis patch fixes that problem by checking the return value of\nbtrfs_read_block_groups, and failing out properly.  I\u0027ve also added a\ncheck in find_free_extent so if for some reason we don\u0027t find an\nappropriate space_info, we just return -ENOSPC.\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "90d2c51dbb4db05c040bc7db264bb7ab35e35455",
      "tree": "d97b50f0a064366aecce9671b8e1791263999e59",
      "parents": [
        "2f3014fc2ab1e25c36531e19164c48182c168995"
      ],
      "author": {
        "name": "Miao Xie",
        "email": "miaox@cn.fujitsu.com",
        "time": "Thu Mar 25 12:37:12 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 30 21:19:08 2010 -0400"
      },
      "message": "Btrfs: add NULL check for do_walk_down()\n\nbtrfs_find_create_tree_block() may return NULL, so we must check the returned\nvalue, or we will access a NULL pointer.\n\nSigned-off-by: Miao Xie \u003cmiaox@cn.fujitsu.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "5a0e3ad6af8660be21ca98a971cd00f331318c05",
      "tree": "5bfb7be11a03176a87296a43ac6647975c00a1d1",
      "parents": [
        "ed391f4ebf8f701d3566423ce8f17e614cde9806"
      ],
      "author": {
        "name": "Tejun Heo",
        "email": "tj@kernel.org",
        "time": "Wed Mar 24 17:04:11 2010 +0900"
      },
      "committer": {
        "name": "Tejun Heo",
        "email": "tj@kernel.org",
        "time": "Tue Mar 30 22:02:32 2010 +0900"
      },
      "message": "include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h\n\npercpu.h is included by sched.h and module.h and thus ends up being\nincluded when building most .c files.  percpu.h includes slab.h which\nin turn includes gfp.h making everything defined by the two files\nuniversally available and complicating inclusion dependencies.\n\npercpu.h -\u003e slab.h dependency is about to be removed.  Prepare for\nthis change by updating users of gfp and slab facilities include those\nheaders directly instead of assuming availability.  As this conversion\nneeds to touch large number of source files, the following script is\nused as the basis of conversion.\n\n  http://userweb.kernel.org/~tj/misc/slabh-sweep.py\n\nThe script does the followings.\n\n* Scan files for gfp and slab usages and update includes such that\n  only the necessary includes are there.  ie. if only gfp is used,\n  gfp.h, if slab is used, slab.h.\n\n* When the script inserts a new include, it looks at the include\n  blocks and try to put the new include such that its order conforms\n  to its surrounding.  It\u0027s put in the include block which contains\n  core kernel includes, in the same order that the rest are ordered -\n  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there\n  doesn\u0027t seem to be any matching order.\n\n* If the script can\u0027t find a place to put a new include (mostly\n  because the file doesn\u0027t have fitting include block), it prints out\n  an error message indicating which .h file needs to be added to the\n  file.\n\nThe conversion was done in the following steps.\n\n1. The initial automatic conversion of all .c files updated slightly\n   over 4000 files, deleting around 700 includes and adding ~480 gfp.h\n   and ~3000 slab.h inclusions.  The script emitted errors for ~400\n   files.\n\n2. Each error was manually checked.  Some didn\u0027t need the inclusion,\n   some needed manual addition while adding it to implementation .h or\n   embedding .c file was more appropriate for others.  This step added\n   inclusions to around 150 files.\n\n3. The script was run again and the output was compared to the edits\n   from #2 to make sure no file was left behind.\n\n4. Several build tests were done and a couple of problems were fixed.\n   e.g. lib/decompress_*.c used malloc/free() wrappers around slab\n   APIs requiring slab.h to be added manually.\n\n5. The script was run on all .h files but without automatically\n   editing them as sprinkling gfp.h and slab.h inclusions around .h\n   files could easily lead to inclusion dependency hell.  Most gfp.h\n   inclusion directives were ignored as stuff from gfp.h was usually\n   wildly available and often used in preprocessor macros.  Each\n   slab.h inclusion directive was examined and added manually as\n   necessary.\n\n6. percpu.h was updated not to include slab.h.\n\n7. Build test were done on the following configurations and failures\n   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my\n   distributed build env didn\u0027t work with gcov compiles) and a few\n   more options had to be turned off depending on archs to make things\n   build (like ipr on powerpc/64 which failed due to missing writeq).\n\n   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.\n   * powerpc and powerpc64 SMP allmodconfig\n   * sparc and sparc64 SMP allmodconfig\n   * ia64 SMP allmodconfig\n   * s390 SMP allmodconfig\n   * alpha SMP allmodconfig\n   * um on x86_64 SMP allmodconfig\n\n8. percpu.h modifications were reverted so that it could be applied as\n   a separate patch and serve as bisection point.\n\nGiven the fact that I had only a couple of failures from tests on step\n6, I\u0027m fairly confident about the coverage of this conversion patch.\nIf there is a breakage, it\u0027s likely to be something in one of the arch\nheaders which should be easily discoverable easily on most builds of\nthe specific arch.\n\nSigned-off-by: Tejun Heo \u003ctj@kernel.org\u003e\nGuess-its-ok-by: Christoph Lameter \u003ccl@linux-foundation.org\u003e\nCc: Ingo Molnar \u003cmingo@redhat.com\u003e\nCc: Lee Schermerhorn \u003cLee.Schermerhorn@hp.com\u003e\n"
    },
    {
      "commit": "2ac55d41b5d6bf49e76bc85db5431240617e2f8f",
      "tree": "ee8e2a716ef0b50388ef5e4a86387ec0499bca89",
      "parents": [
        "5a1a3df1f6c86926cfe8657e6f9b4b4c2f467d60"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Wed Feb 03 19:33:23 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Mar 15 11:00:13 2010 -0400"
      },
      "message": "Btrfs: cache the extent state everywhere we possibly can V2\n\nThis patch just goes through and fixes everybody that does\n\nlock_extent()\nblah\nunlock_extent()\n\nto use\n\nlock_extent_bits()\nblah\nunlock_extent_cached()\n\nand pass around a extent_state so we only have to do the searches once per\nfunction.  This gives me about a 3 mb/s boots on my random write test.  I have\nnot converted some things, like the relocation and ioctl\u0027s, since they aren\u0027t\nheavily used and the relocation stuff is in the middle of being re-written.  I\nalso changed the clear_extent_bit() to only unset the cached state if we are\nclearing EXTENT_LOCKED and related stuff, so we can do things like this\n\nlock_extent_bits()\nclear delalloc bits\nunlock_extent_cached()\n\nwithout losing our cached state.  I tested this thoroughly and turned on\nLEAK_DEBUG to make sure we weren\u0027t leaking extent states, everything worked out\nfine.\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "7a7965f83e89f0be506a96769938a721e4e5ae50",
      "tree": "be4ffe67af162c6c7cfd0780c507fd5f2d522635",
      "parents": [
        "d7ce5843bb28ada6845ab2ae8510ba3f12d33154"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Mon Feb 01 02:41:17 2010 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 04 11:31:45 2010 -0500"
      },
      "message": "Btrfs: Fix oopsen when dropping empty tree.\n\nWhen dropping a empty tree, walk_down_tree() skips checking\nextent information for the tree root. This will triggers a\nBUG_ON in walk_up_proc().\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "11dfe35a0108097f2df1f042c485fa7f758c2cdf",
      "tree": "83d5af6992db15ee61bc0c960626c378a2f5b436",
      "parents": [
        "a9cc71a60c29a09174bee2fcef8f924c529fd4b7"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Nov 13 20:12:59 2009 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Sun Jan 17 20:40:30 2010 -0500"
      },
      "message": "Btrfs: fix possible panic on unmount\n\nWe can race with the unmount of an fs and the stopping of a kthread where we\nwill free the block group before we\u0027re done using it.  The reason for this is\nbecause we do not hold a reference on the block group while its caching, since\nthe allocator drops its reference once it exits or moves on to the next block\ngroup.  This patch fixes the problem by taking a reference to the block group\nbefore we start caching and dropping it when we\u0027re done to make sure all\naccesses to the block group are safe.  Thanks,\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "83d3c9696fed237a3d96fce18299e2fcf112109f",
      "tree": "cafe54ba7801332c54adab5b1af3e0865bc32386",
      "parents": [
        "20a5239a5d0f340e29827a6a2d28a138001c44b8"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Mon Dec 07 21:45:59 2009 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Dec 17 12:33:38 2009 -0500"
      },
      "message": "Btrfs: make metadata chunks smaller\n\nThis patch makes us a bit less zealous about making sure we have enough free\nmetadata space by pearing down the size of new metadata chunks to 256mb instead\nof 1gb.  Also, we used to try an allocate metadata chunks when allocating data,\nbut that sort of thing is done elsewhere now so we can just remove it.  With my\n-ENOSPC test I used to have 3gb reserved for metadata out of 75gb, now I have\n1.7gb.  Thanks,\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "06b2331f8333ec6edf41662757ce8882cc1747d5",
      "tree": "9b8316a84e2cb5fa5ed4d16cdbfecd965ed7870c",
      "parents": [
        "86b9f2eca5e0984145e3c7698a7cd6dd65c2a93f"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Nov 26 09:31:11 2009 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Dec 17 12:33:36 2009 -0500"
      },
      "message": "Btrfs: don\u0027t add extent 0 to the free space cache v2\n\nIf block group 0 is completely free, btrfs_read_block_groups will\nadd extent [0, BTRFS_SUPER_INFO_OFFSET) to the free space cache.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "86b9f2eca5e0984145e3c7698a7cd6dd65c2a93f",
      "tree": "75dd0a52848b6f5396023f811f1a602f62b9d34e",
      "parents": [
        "55ef68990029fcd8d04d42fc184aa7fb18cf309e"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Nov 12 09:36:50 2009 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Dec 17 12:33:35 2009 -0500"
      },
      "message": "Btrfs: Fix per root used space accounting\n\nThe bytes_used field in root item was originally planned to\ntrace the amount of used data and tree blocks. But it never\nworked right since we can\u0027t trace freeing of data accurately.\nThis patch changes it to only trace the amount of tree blocks.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "24bbcf0442ee04660a5a030efdbb6d03f1c275cb",
      "tree": "aa57d77d29cc5150b272cc3f6465f10262fcbaac",
      "parents": [
        "f34f57a3ab4e73304d78c125682f1a53cd3975f2"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Nov 12 09:36:34 2009 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Dec 17 12:33:35 2009 -0500"
      },
      "message": "Btrfs: Add delayed iput\n\niput() can trigger new transactions if we are dropping the\nfinal reference, so calling it in btrfs_commit_transaction\nmay end up deadlock. This patch adds delayed iput to avoid\nthe issue.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "8cef4e160d74920ad1725f58c89fd75ec4c4ac38",
      "tree": "c1592369c7085e75d67a1709438a4f56351b2348",
      "parents": [
        "22763c5cf3690a681551162c15d34d935308c8d7"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Nov 12 09:33:26 2009 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Dec 15 21:24:25 2009 -0500"
      },
      "message": "Btrfs: Avoid superfluous tree-log writeout\n\nWe allow two log transactions at a time, but use same flag\nto mark dirty tree-log btree blocks. So we may flush dirty\nblocks belonging to newer log transaction when committing a\nlog transaction. This patch fixes the issue by using two\nflags to mark dirty tree-log btree blocks.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "aa021baa3295fa6e3f367d80f8955dd5176656eb",
      "tree": "13da8275b1957399bc4fa19ec7cc313d48694e31",
      "parents": [
        "404291ac9e72d118fcadeb939a69b2caa0a0e9ca",
        "a6dbd429d8dd3382bbd9594b8d2ec74843a260d9"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Nov 11 13:38:59 2009 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Nov 11 13:38:59 2009 -0800"
      },
      "message": "Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:\n  Btrfs: fix panic when trying to destroy a newly allocated\n  Btrfs: allow more metadata chunk preallocation\n  Btrfs: fallback on uncompressed io if compressed io fails\n  Btrfs: find ideal block group for caching\n  Btrfs: avoid null deref in unpin_extent_cache()\n  Btrfs: skip btrfs_release_path in btrfs_update_root and btrfs_del_root\n  Btrfs: fix some metadata enospc issues\n  Btrfs: fix how we set max_size for free space clusters\n  Btrfs: cleanup transaction starting and fix journal_info usage\n  Btrfs: fix data allocation hint start\n"
    },
    {
      "commit": "33b258086441dd07e00133c79fcd8cbc6a76d737",
      "tree": "beab74a12b7650576dbe2f97301f0905699d4292",
      "parents": [
        "f5a84ee3cdd88d96b7bcede10af58598ad8d52a7"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Nov 11 10:16:57 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Nov 11 14:20:20 2009 -0500"
      },
      "message": "Btrfs: allow more metadata chunk preallocation\n\nOn an FS where all of the space has not been allocated into chunks yet,\nthe enospc can return enospc just because the existing metadata chunks\nare full.\n\nWe get around this by allowing more metadata chunks to be allocated up\nto a certain limit, and finding the right limit is a little fuzzy.  The\nproblem is the reservations for delalloc would preallocate way too much\nof the FS as metadata.  We need to start saying no and just force some\nIO to happen.\n\nBut we also need to let a reasonable amount of the FS become metadata.\nThis bumps the hard limit up, later releases will have a better system.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "ccf0e72537a9f68611ca575121afd08e2b4d0fb0",
      "tree": "d2fd54693847b6ed1307ed1eb5d3f87b95e31538",
      "parents": [
        "4eb3991c5def39bcf553c14ebe2618fcb47b627f"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Tue Nov 10 21:23:48 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Nov 11 14:20:19 2009 -0500"
      },
      "message": "Btrfs: find ideal block group for caching\n\nThis patch changes a few things.  Hopefully the comments are helpfull, but\nI\u0027ll try and be as verbose here.\n\nProblem:\n\nMy fedora box was taking 1 minute and 21 seconds to boot with btrfs as root.\nPart of this problem was we pick the first block group we can find and start\ncaching it, even if it may not have enough free space.  The other problem is\nwe only search for cached block groups the first time around, which we won\u0027t\nfind any cached block groups because this is a newly mounted fs, so we end up\ncaching several block groups during bootup, which with alot of fragmentation\ntakes around 30-45 seconds to complete, which bogs down the system.  So\n\nSolution:\n\n1) Don\u0027t cache block groups willy-nilly at first.  Instead try and figure out\nwhich block group has the most free, and therefore will take the least amount\nof time to cache.\n\n2) Don\u0027t be so picky about cached block groups.  The other problem is once\nwe\u0027ve filled up a cluster, if the block group isn\u0027t finished caching the next\ntime we try and do the allocation we\u0027ll completely ignore the cluster and\nstart searching from the beginning of the space, which makes us cache more\nblock groups, which slows us down even more.  So instead of skipping block\ngroups that are not finished caching when we have a hint, only skip the block\ngroup if it hasn\u0027t started caching yet.\n\nThere is one other tweak in here.  Before if we allocated a chunk and still\ncouldn\u0027t find new space, we\u0027d end up switching the space info to force another\nchunk allocation.  This could make us end up with way too many chunks, so keep\ntrack of this particular case.\n\nWith this patch and my previous cluster fixes my fedora box now boots in 43\nseconds, and according to the bootchart is not held up by our block group\ncaching at all.\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "dcbeb0bec5f2695c3ff53f174efb8e03c209f3f3",
      "tree": "30d223a3a3c7470c657284ef030657bd1753d4d3",
      "parents": [
        "2b650df2cea96e487f2fd9ecaa68e533ea9b5ed7",
        "444528b3e614f7f2391488d9bca8e0b872db909b"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Oct 15 15:06:37 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Oct 15 15:06:37 2009 -0700"
      },
      "message": "Merge branch \u0027master\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* \u0027master\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:\n  Btrfs: always pin metadata in discard mode\n  Btrfs: enable discard support\n  Btrfs: add -o discard option\n  Btrfs: properly wait log writers during log sync\n  Btrfs: fix possible ENOSPC problems with truncate\n  Btrfs: fix btrfs acl #ifdef checks\n  Btrfs: streamline tree-log btree block writeout\n  Btrfs: avoid tree log commit when there are no changes\n  Btrfs: only write one super copy during fsync\n"
    },
    {
      "commit": "444528b3e614f7f2391488d9bca8e0b872db909b",
      "tree": "5326be87610ed3fc7a14d0f28e96e5e22207cf5f",
      "parents": [
        "0634857488ec6e28fa22920cd0bee3c2ac07ccfd"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Oct 14 09:38:28 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Oct 14 10:32:50 2009 -0400"
      },
      "message": "Btrfs: always pin metadata in discard mode\n\nWe have an optimization in btrfs to allow blocks to be\nimmediately freed if they were allocated in this transaction and never\nwritten.  Otherwise they are pinned and freed when the transaction\ncommits.\n\nThis isn\u0027t optimal for discard mode because immediately freeing\nthem means immediately discarding them.  It is better to give the\nblock to the pinning code and letting the (slow) discard happen later.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "0634857488ec6e28fa22920cd0bee3c2ac07ccfd",
      "tree": "6cfa348aea76f39b658d3a36ab51807a4ac7bcf7",
      "parents": [
        "e244a0aeb6a599c19a7c802cda6e2d67c847b154"
      ],
      "author": {
        "name": "Christoph Hellwig",
        "email": "hch@lst.de",
        "time": "Wed Oct 14 09:24:59 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Oct 14 10:32:49 2009 -0400"
      },
      "message": "Btrfs: enable discard support\n\nThe discard support code in btrfs currently is guarded by ifdefs for\nBIO_RW_DISCARD, which is never defines as it\u0027s the name of an enum\nmemeber.  Just remove the useless ifdefs to actually enable the code.\n\nSigned-off-by: Christoph Hellwig \u003chch@lst.de\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "e244a0aeb6a599c19a7c802cda6e2d67c847b154",
      "tree": "392d8d48c4e6676a552230135ad448d522007ece",
      "parents": [
        "86df7eb921a009515285e7171363fa57dd2d7d31"
      ],
      "author": {
        "name": "Christoph Hellwig",
        "email": "hch@lst.de",
        "time": "Wed Oct 14 09:24:59 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Oct 14 10:32:49 2009 -0400"
      },
      "message": "Btrfs: add -o discard option\n\nEnable discard by default is not a good idea given the the trim speed\nof SSD prototypes we\u0027ve seen, and the carecteristics for many high-end\narrays.  Turn of discards by default and require the -o discard option\nto enable them on.\n\nSigned-off-by: Christoph Hellwig \u003chch@lst.de\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "474a503d4bf77ae0cbe484dd0842a2648c0b1c28",
      "tree": "70e3e4023209e741546491a58622bd45fb13e308",
      "parents": [
        "d43c36dc6b357fa1806800f18aa30123c747a6d1",
        "ac6889cbb254be1ffea376bea4a96ce9be0e0ed0"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Sun Oct 11 11:23:13 2009 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Sun Oct 11 11:23:13 2009 -0700"
      },
      "message": "Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable\n\n* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:\n  Btrfs: fix file clone ioctl for bookend extents\n  Btrfs: fix uninit compiler warning in cow_file_range_nocow\n  Btrfs: constify dentry_operations\n  Btrfs: optimize back reference update during btrfs_drop_snapshot\n  Btrfs: remove negative dentry when deleting subvolumne\n  Btrfs: optimize fsync for the single writer case\n  Btrfs: async delalloc flushing under space pressure\n  Btrfs: release delalloc reservations on extent item insertion\n  Btrfs: delay clearing EXTENT_DELALLOC for compressed extents\n  Btrfs: cleanup extent_clear_unlock_delalloc flags\n  Btrfs: fix possible softlockup in the allocator\n  Btrfs: fix deadlock on async thread startup\n"
    },
    {
      "commit": "94fcca9f8999e7828d5f4dc181daa39cad2af38a",
      "tree": "68842517a4d10d080bc4f70abae19e480d2ac049",
      "parents": [
        "efefb1438be269897585934fc6c05deb4dfa01ce"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Fri Oct 09 09:25:16 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Oct 09 09:25:16 2009 -0400"
      },
      "message": "Btrfs: optimize back reference update during btrfs_drop_snapshot\n\nThis patch reading level 0 tree blocks that already use full backrefs.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "e3ccfa989752c083ceb23c823a84f7ce3a081e61",
      "tree": "197558cbee7b773b8270cd861f882a37beacd2ed",
      "parents": [
        "32c00aff718bb54a214b39146bdd9ac01511cd25"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Wed Oct 07 20:44:34 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Oct 08 15:21:23 2009 -0400"
      },
      "message": "Btrfs: async delalloc flushing under space pressure\n\nThis patch moves the delalloc flushing that occurs when we are under space\npressure off to a async thread pool.  This helps since we only free up\nmetadata space when we actually insert the extent item, which means it takes\nquite a while for space to be free\u0027ed up if we wait on all ordered extents.\nHowever, if space is freed up due to inline extents being inserted, we can\nwake people who are waiting up early, and they can finish their work.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "32c00aff718bb54a214b39146bdd9ac01511cd25",
      "tree": "c094ee494723a9ebc9d83cb95607f06351665639",
      "parents": [
        "a3429ab70b04363c6190964e82f04f44f3e34cf0"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Thu Oct 08 13:34:05 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Oct 08 15:21:10 2009 -0400"
      },
      "message": "Btrfs: release delalloc reservations on extent item insertion\n\nThis patch fixes an issue with the delalloc metadata space reservation\ncode.  The problem is we used to free the reservation as soon as we\nallocated the delalloc region.  The problem with this is if we are not\ninserting an inline extent, we don\u0027t actually insert the extent item until\nafter the ordered extent is written out.  This patch does 3 things,\n\n1) It moves the reservation clearing stuff into the ordered code, so when\nwe remove the ordered extent we remove the reservation.\n2) It adds a EXTENT_DO_ACCOUNTING flag that gets passed when we clear\ndelalloc bits in the cases where we want to clear the metadata reservation\nwhen we clear the delalloc extent, in the case that we do an inline extent\nor we invalidate the page.\n3) It adds another waitqueue to the space info so that when we start a fs\nwide delalloc flush, anybody else who also hits that area will simply wait\nfor the flush to finish and then try to make their allocation.\n\nThis has been tested thoroughly to make sure we did not regress on\nperformance.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "1cdda9b81ac0e6ee986f034fa02f221679e1c11a",
      "tree": "ae9394e50bc2418e8c3054de12ed44962d6f261a",
      "parents": [
        "61d92c328c16419fc96dc50dd16f8b8c695409ec"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Tue Oct 06 10:04:28 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Oct 06 10:04:28 2009 -0400"
      },
      "message": "Btrfs: fix possible softlockup in the allocator\n\nLike the cluster allocating stuff, we can lockup the box with the normal\nallocation path.  This happens when we\n\n1) Start to cache a block group that is severely fragmented, but has a decent\namount of free space.\n2) Start to commit a transaction\n3) Have the commit try and empty out some of the delalloc inodes with extents\nthat are relatively large.\n\nThe inodes will not be able to make the allocations because they will ask for\nallocations larger than a contiguous area in the free space cache.  So we will\nwait for more progress to be made on the block group, but since we\u0027re in a\ncommit the caching kthread won\u0027t make any more progress and it already has\nenough free space that wait_block_group_cache_progress will just return.  So,\nif we wait and fail to make the allocation the next time around, just loop and\ngo to the next block group.  This keeps us from getting stuck in a softlockup.\nThanks,\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "25472b880c69c0daa485c4f80a6550437ed1149f",
      "tree": "d12bc091e8991513db0d2891111ba773eb5c52e2",
      "parents": [
        "17d857be649a21ca90008c6dc425d849fa83db5c",
        "ab93dbecfba72bbc04b7036343d180aaff1b61a3"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Oct 01 12:58:13 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Oct 01 12:58:13 2009 -0400"
      },
      "message": "Merge branch \u0027master\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable into for-linus\n"
    },
    {
      "commit": "dd7e0b7b02ccff73b87032e20fc5b4f2c1cfcc14",
      "tree": "2168da63d84f05106b2aa8eb8f5cdc8859f1e176",
      "parents": [
        "1ab86aedbc7845a946b4ba4edf37762629970708"
      ],
      "author": {
        "name": "Sage Weil",
        "email": "sage@newdream.net",
        "time": "Tue Sep 29 18:38:44 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Sep 29 19:50:07 2009 -0400"
      },
      "message": "Btrfs: fix deadlock with free space handling and user transactions\n\nIf an ioctl-initiated transaction is open, we can\u0027t force a commit during\nthe free space checks in order to free up pinned extents or else we\ndeadlock.  Just ENOSPC instead.\n\nA more satisfying solution that reserves space for the entire user\ntransaction up front is forthcoming...\n\nSigned-off-by: Sage Weil \u003csage@newdream.net\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "9ed74f2dba6ebf9f30b80554290bfc73cc3ef083",
      "tree": "763d58a4a11ceca26dcdaedefb1fd662c4e2fa8b",
      "parents": [
        "c65ddb52dc412c9b67681b1aa16cd1bac8434e24"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Sep 11 16:12:44 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 28 16:29:42 2009 -0400"
      },
      "message": "Btrfs: proper -ENOSPC handling\n\nAt the start of a transaction we do a btrfs_reserve_metadata_space() and\nspecify how many items we plan on modifying.  Then once we\u0027ve done our\nmodifications and such, just call btrfs_unreserve_metadata_space() for\nthe same number of items we reserved.\n\nFor keeping track of metadata needed for data I\u0027ve had to add an extent_io op\nfor when we merge extents.  This lets us track space properly when we are doing\nsequential writes, so we don\u0027t end up reserving way more metadata space than\nwhat we need.\n\nThe only place where the metadata space accounting is not done is in the\nrelocation code.  This is because Yan is going to be reworking that code in the\nnear future, so running btrfs-vol -b could still possibly result in a ENOSPC\nrelated panic.  This patch also turns off the metadata_ratio stuff in order to\nallow users to more efficiently use their disk space.\n\nThis patch makes it so we track how much metadata we need for an inode\u0027s\ndelayed allocation extents by tracking how many extents are currently\nwaiting for allocation.  It introduces two new callbacks for the\nextent_io tree\u0027s, merge_extent_hook and split_extent_hook.  These help\nus keep track of when we merge delalloc extents together and split them\nup.  Reservations are handled prior to any actually dirty\u0027ing occurs,\nand then we unreserve after we dirty.\n\nbtrfs_unreserve_metadata_for_delalloc() will make the appropriate\nunreservations as needed based on the number of reservations we\ncurrently have and the number of extents we currently have.  Doing the\nreservation outside of doing any of the actual dirty\u0027ing lets us do\nthings like filemap_flush() the inode to try and force delalloc to\nhappen, or as a last resort actually start allocation on all delalloc\ninodes in the fs.  This has survived dbench, fs_mark and an fsx torture\ntest.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "54bcf382daf08c1396edb8b81e650b58930ccaef",
      "tree": "64b941f09489b5c9ee63e4ad43d736bfce911b21",
      "parents": [
        "94a8d5caba74211ec76dac80fc6e2d5c391530df",
        "c65ddb52dc412c9b67681b1aa16cd1bac8434e24"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Sep 24 10:00:58 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Sep 24 10:00:58 2009 -0400"
      },
      "message": "Merge branch \u0027master\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable into for-linus\n\nConflicts:\n\tfs/btrfs/super.c\n"
    },
    {
      "commit": "7ce618db9878689f87897b673fa3329070860fc7",
      "tree": "a149e88a2f28c2fd5ad515f7351af9832540fedb",
      "parents": [
        "33b4d47f5e24b986f486d7de9a2df915ad1fdfbc"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Sep 22 14:48:44 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Sep 22 14:48:44 2009 -0400"
      },
      "message": "Btrfs: fix early enospc during balancing\n\nWe now do extra checks before a balance to make sure\nthere is room for the balance to take place.  One of\nthe checks was testing to see if we were trying to\nbalance away the last block group of a given type.\n\nIf there is no space available for new chunks, we\nshould not try and balance away the last block group\nof a give type.  But, the code wasn\u0027t checking for\navailable chunk space, and so it was exiting too soon.\n\nThe fix here is to combine some of the checks and make\nsure we try to allocate new chunks when we\u0027re balancing\nthe last block group.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "33b4d47f5e24b986f486d7de9a2df915ad1fdfbc",
      "tree": "198fb5c7d48bfd9e4010eb253e9e7573172a7680",
      "parents": [
        "1b2da372b0324b5c604fc8790e70a7efbeacb0b6"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Sep 22 14:45:50 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Sep 22 14:45:50 2009 -0400"
      },
      "message": "Btrfs: deal with NULL space info\n\nAfter a balance it is briefly possible for the space info\nfield in the inode to be NULL.  This adds some checks\nto make sure things properly deal with the NULL value.\n\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "1b2da372b0324b5c604fc8790e70a7efbeacb0b6",
      "tree": "13d7ba24660c865efd184a25b7b0ac8830a6d7f1",
      "parents": [
        "25891f796d8d30f2b86b1e84d78721b44d573d70"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Sep 11 16:11:20 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 21 19:23:50 2009 -0400"
      },
      "message": "Btrfs: account for space used by the super mirrors\n\nAs we get closer to proper -ENOSPC handling in btrfs, we need more accurate\nspace accounting for the space info\u0027s.  Currently we exclude the free space for\nthe super mirrors, but the space they take up isn\u0027t accounted for in any of the\ncounters.  This patch introduces bytes_super, which keeps track of the amount\nof bytes used for a super mirror in the block group cache and space info.  This\nmakes sure that our free space caclucations will be completely accurate.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "f61408b81cd040a594dc0b65171230c4d5cc917d",
      "tree": "0fe8757007b75ecbdb369b9f2d9750696d822092",
      "parents": [
        "f019f4264ae8c0169332592bcee419ee90e7c827"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Sep 11 16:11:20 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 21 19:23:49 2009 -0400"
      },
      "message": "Btrfs: remove dead code\n\nThis patch removes a bunch of dead code from the snapshot removal stuff.  It\nwas confusing me when doing the metadata ENOSPC stuff so I killed it.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "0a24325e6d8cfb150eba0aa279615ef27b5f6aec",
      "tree": "f0ca16ab43d87d526a1f918c7e960711256fd47f",
      "parents": [
        "ba1bf4818baf68d914ef9e3b06fbea6acb674fe4"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Sep 11 16:11:20 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 21 19:23:49 2009 -0400"
      },
      "message": "Btrfs: don\u0027t keep retrying a block group if we fail to allocate a cluster\n\nThe box can get locked up in the allocator if we happen upon a block group\nunder these conditions:\n\n1) During a commit, so caching threads cannot make progress\n2) Our block group currently is in the middle of being cached\n3) Our block group currently has plenty of free space in it\n4) Our block group is so fragmented that it ends up having no free space chunks\nlarger than min_bytes calculated by btrfs_find_space_cluster.\n\nWhat happens is we try and do btrfs_find_space_cluster, which fails because it\nis unable to find enough free space chunks that are large than min_bytes and\nare close enough together.  Since the block group is not cached we do a\nwait_block_group_cache_progress, which waits for the number of bytes we need,\nexcept the block group already has _plenty_ of free space, its just severely\nfragmented, so we loop and try again, ad infinitum.  This patch keeps us from\nwaiting on the block group to finish caching if we failed to find a free space\ncluster before.  It also makes sure that we don\u0027t even try to find a free space\ncluster if we are on our last loop in the allocator, since we will have tried\neverything at this point at it is futile.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "ba1bf4818baf68d914ef9e3b06fbea6acb674fe4",
      "tree": "1068d6ce508333a75668181bfe0e42956d4d8780",
      "parents": [
        "1fb58a6051cd904a9f8e0344b22e31921d6b5a4d"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Fri Sep 11 16:11:19 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 21 19:23:48 2009 -0400"
      },
      "message": "Btrfs: make balance code choose more wisely when relocating\n\nCurrently, we can panic the box if the first block group we go to move is of a\ntype where there is no space left to move those extents.  For example, if we\nfill the disk up with data, and then we try to balance and we have no room to\nmove the data nor room to allocate new chunks, we will panic.  Change this by\nchecking to see if we have room to move this chunk around, and if not, return\n-ENOSPC and move on to the next chunk.  This will make sure we remove block\ngroups that are moveable, like if we have alot of empty metadata block groups,\nand then that way we make room to be able to balance our data chunks as well.\nTested this with an fs that would panic on btrfs-vol -b normally, but no longer\npanics with this patch.\n\nV1-\u003eV2:\n-actually search for a free extent on the device to make sure we can allocate a\nchunk if need be.\n\n-fix btrfs_shrink_device to make sure we actually try to relocate all the\nchunks, and then if we can\u0027t return -ENOSPC so if we are doing a btrfs-vol -r\nwe don\u0027t remove the device with data still on it.\n\n-check to make sure the block group we are going to relocate isn\u0027t the last one\nin that particular space\n\n-fix a bug in btrfs_shrink_device where we would change the device\u0027s size and\nnot fix it if we fail to do our relocate\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "76dda93c6ae2c1dc3e6cde34569d6aca26b0c918",
      "tree": "f5ca46ec89d4ae2c762952d5f35e2c6f95ac046a",
      "parents": [
        "4df27c4d5cc1dda54ed7d0a8389347f2df359cf9"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Mon Sep 21 16:00:26 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 21 16:00:26 2009 -0400"
      },
      "message": "Btrfs: add snapshot/subvolume destroy ioctl\n\nThis patch adds snapshot/subvolume destroy ioctl.  A subvolume that isn\u0027t being\nused and doesn\u0027t contains links to other subvolumes can be destroyed.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "1c4850e21df8b441164d910bc611ef46a01d5d75",
      "tree": "aeccbf3495421d1343bbe08cb824ac1ae6764e43",
      "parents": [
        "b917b7c3be50435fa8257591b964934e917f2d45"
      ],
      "author": {
        "name": "Yan, Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Mon Sep 21 15:55:59 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Sep 21 15:55:59 2009 -0400"
      },
      "message": "Btrfs: speed up snapshot dropping\n\nThis patch contains two changes to avoid unnecessary tree block reads during\nsnapshot dropping.\n\nFirst, check tree block\u0027s reference count and flags before reading the tree\nblock. if reference count \u003e 1 and there is no need to update backrefs, we can\navoid reading the tree block.\n\nSecond, save when snapshot was created in root_key.offset. we can compare block\npointer\u0027s generation with snapshot\u0027s creation generation during updating\nbackrefs. If a given block was created before snapshot was created, the\nsnapshot can\u0027t be the tree block\u0027s owner. So we can avoid reading the block.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "11833d66be94b514652466802100378046c16b72",
      "tree": "2b00b36d0aa42e9e10cecf3bf723eb70a607afec",
      "parents": [
        "6e74057c4686dc12ea767b4bdc50a63876056e1c"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Fri Sep 11 16:11:19 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Sep 17 15:47:36 2009 -0400"
      },
      "message": "Btrfs: improve async block group caching\n\nThis patch gets rid of two limitations of async block group caching.\nThe old code delays handling pinned extents when block group is in\ncaching. To allocate logged file extents, the old code need wait\nuntil block group is fully cached. To get rid of the limitations,\nThis patch introduces a data structure to track the progress of\ncaching. Base on the caching progress, we know which extents should\nbe added to the free space cache when handling the pinned extents.\nThe logged file extents are also handled in a similar way.\n\nThis patch also changes how pinned extents are tracked. The old\ncode uses one tree to track pinned extents, and copy the pinned\nextents tree at transaction commit time. This patch makes it use\ntwo trees to track pinned extents. One tree for extents that are\npinned in the running transaction, one tree for extents that can\nbe unpinned. At transaction commit time, we swap the two trees.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "746cd1e7e4a555ddaee53b19a46e05c9c61eaf09",
      "tree": "d129194669e0122113a5cc86003a4a7711450284",
      "parents": [
        "3d2257f157c2324acbc0fa0fa54e8626a987edd2"
      ],
      "author": {
        "name": "Christoph Hellwig",
        "email": "hch@infradead.org",
        "time": "Sat Sep 12 07:35:43 2009 +0200"
      },
      "committer": {
        "name": "Jens Axboe",
        "email": "jens.axboe@oracle.com",
        "time": "Mon Sep 14 08:24:53 2009 +0200"
      },
      "message": "block: use blkdev_issue_discard in blk_ioctl_discard\n\nblk_ioctl_discard duplicates large amounts of code from blkdev_issue_discard,\nthe only difference between the two is that blkdev_issue_discard needs to\nsend a barrier discard request and blk_ioctl_discard a non-barrier one,\nand blk_ioctl_discard needs to wait on the request.  To facilitates this\nadd a flags argument to blkdev_issue_discard to control both aspects of the\nbehaviour.  This will be very useful later on for using the waiting\nfuncitonality for other callers.\n\nBased on an earlier patch from Matthew Wilcox \u003cmatthew@wil.cx\u003e.\n\nSigned-off-by: Christoph Hellwig \u003chch@lst.de\u003e\nSigned-off-by: Jens Axboe \u003cjens.axboe@oracle.com\u003e\n"
    },
    {
      "commit": "890871be854b5f5e43e7ba2475f706209906cc24",
      "tree": "9d087adf7a28bb910992d07d93ea2a992e394110",
      "parents": [
        "57fd5a5ff8b48b99e90b22fc143082aba755c6c0"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Sep 02 16:24:52 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Sep 11 13:31:05 2009 -0400"
      },
      "message": "Btrfs: switch extent_map to a rw lock\n\nThere are two main users of the extent_map tree.  The\nfirst is regular file inodes, where it is evenly spread\nbetween readers and writers.\n\nThe second is the chunk allocation tree, which maps blocks from\nlogical addresses to phyiscal ones, and it is 99.99% reads.\n\nThe mapping tree is a point of lock contention during heavy IO\nworkloads, so this commit switches things to a rw lock.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "013f1b12f4fc479f697acae2f31bad220162cd03",
      "tree": "b51225aa32f249de352840b31b49eb9799fdafe8",
      "parents": [
        "6606bb97e146a387932efee263745b7240a11193"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jul 31 14:57:55 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jul 31 14:57:55 2009 -0400"
      },
      "message": "Btrfs: make sure the async caching thread advances the key\n\nThe async caching thread can end up looping forever if a given\nsearch puts it at the last key in a leaf.  It will end up calling\nbtrfs_next_leaf and then checking if it needs to politely drop\nthe read semaphore.\n\nMost of the time this looping isn\u0027t noticed because it is able to\nmake progress the next time around.  But, during log replay,\nwe wait on the async caching thread to finish, and the async thread\nis waiting on the commit, and no progress is really made.\n\nThe fix used here is to copy the key out of the next leaf,\nthat way our search lands there properly.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "f36f3042eae238bdaefe7c79310afe573bfc3622",
      "tree": "83ea0e271dedeef36423509be7f4189b838d14b5",
      "parents": [
        "276e680d192a67d222fcea51af37b056feffb665"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jul 30 10:04:48 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jul 30 10:14:46 2009 -0400"
      },
      "message": "Btrfs: be more polite in the async caching threads\n\nThe semaphore used by the async caching threads can prevent a\ntransaction commit, which can make the FS appear to stall.  This\nreleases the semaphore more often when a transaction commit is\nin progress.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "276e680d192a67d222fcea51af37b056feffb665",
      "tree": "137bae016c30f24e7fafcbc8073e3411b732eb31",
      "parents": [
        "f25784b35f590c81d5fb8245a8cd45e1afb6f1b2"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Jul 30 09:40:40 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jul 30 09:40:40 2009 -0400"
      },
      "message": "Btrfs: preserve commit_root for async caching\n\nThe async block group caching code uses the commit_root pointer\nto get a stable version of the extent allocation tree for scanning.\nThis copy of the tree root isn\u0027t going to change and it significantly\nreduces the complexity of the scanning code.\n\nDuring a commit, we have a loop where we update the extent allocation\ntree root.  We need to loop because updating the root pointer in\nthe tree of tree roots may allocate blocks which may change the\nextent allocation tree.\n\nRight now the commit_root pointer is changed inside this loop.  It\nis more correct to change the commit_root pointer only after all the\nlooping is done.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "f25784b35f590c81d5fb8245a8cd45e1afb6f1b2",
      "tree": "71306747041b6e4a5eaccc5028c770fed29b3f87",
      "parents": [
        "68b38550ddbea13d296184bf69edff387618b1d3"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Tue Jul 28 08:41:57 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Jul 28 08:41:57 2009 -0400"
      },
      "message": "Btrfs: Fix async caching interaction with unmount\n\n- don\u0027t stop the caching thread until btrfs_commit_super return.\n\n- if caching is interrupted by umount, set last to (u64)-1.\n  otherwise the un-scanned range of block group will be considered\n  as free extent.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "68b38550ddbea13d296184bf69edff387618b1d3",
      "tree": "c0c3901b77f273ac08c39c641586884f41a90b84",
      "parents": [
        "631c07c8d12bcc6ce4a0fbfbd64ea843d78e2b10"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Mon Jul 27 13:57:01 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Jul 27 13:57:01 2009 -0400"
      },
      "message": "Btrfs: change how we unpin extents\n\nWe are racy with async block caching and unpinning extents.  This patch makes\nthings much less complicated by only unpinning the extent if the block group is\ncached.  We check the block_group-\u003ecached var under the block_group-\u003elock spin\nlock.  If it is set to BTRFS_CACHE_FINISHED then we update the pinned counters,\nand unpin the extent and add the free space back.  If it is not set to this, we\nstart the caching of the block group so the next time we unpin extents we can\nunpin the extent.  This keeps us from racing with the async caching threads,\nlets us kill the fs wide async thread counter, and keeps us from having to set\nDELALLOC bits for every extent we hit if there are caching kthreads going.\n\nOne thing that needed to be changed was btrfs_free_super_mirror_extents.  Now\ninstead of just looking for LOCKED extents, we also look for DIRTY extents,\nsince we could have left some extents pinned in the previous transaction that\nwill never get freed now that we are unmounting, which would cause us to leak\nmemory.  So btrfs_free_super_mirror_extents has been changed to\nbtrfs_free_pinned_extents, and it will clear the extents locked for the super\nmirror, and any remaining pinned extents that may be present.  Thank you,\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "283bb1979fa8580c4037d8df251449368c292a3b",
      "tree": "4207fcd1e595cfb4074b719fd22e70277e72464f",
      "parents": [
        "ebecd3d9d2adba144c15f1d35c78e0c26ead1bfd"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jul 24 16:30:55 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jul 24 16:30:55 2009 -0400"
      },
      "message": "Btrfs: clear all space_info-\u003efull after removing a block group\n\nBtrfs allocates individual extents from block groups, and each\nblock group has a specific type.  It may hold metadata, data\nmirrored or striped etc.\n\nWhen we balance space (btrfs-vol -b) or remove a drive (btrfs-vol -r)\nwe free block groups.  Once a block group is freed, the space it was\nusing on the device may be available for use by new block groups.\n\nbtrfs_remove_block_group was clearing the flag that said\n\u0027our devices are full, don\u0027t even try to allocate new block groups\u0027,\nbut it was only clearing that flag for a specific type of block group.\n\nThis commit clears the full flag for all of the types of block groups,\nmaking it much more likely that we\u0027ll be able to balance space when\nthe drive is close to full.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "817d52f8dba26d0295c26035531c30ce5f1e3c3e",
      "tree": "5230153e86323de48e7e1440352d1b74d2d9961d",
      "parents": [
        "963030817060e4f109be1993b9ae8f81dbf5e11a"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Mon Jul 13 21:29:25 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jul 24 09:23:39 2009 -0400"
      },
      "message": "Btrfs: async block group caching\n\nThis patch moves the caching of the block group off to a kthread in order to\nallow people to allocate sooner.  Instead of blocking up behind the caching\nmutex, we instead kick of the caching kthread, and then attempt to make an\nallocation.  If we cannot, we wait on the block groups caching waitqueue, which\nthe caching kthread will wake the waiting threads up everytime it finds 2 meg\nworth of space, and then again when its finished caching.  This is how I tested\nthe speedup from this\n\nmkfs the disk\nmount the disk\nfill the disk up with fs_mark\nunmount the disk\nmount the disk\ntime touch /mnt/foo\n\nWithout my changes this took 11 seconds on my box, with these changes it now\ntakes 1 second.\n\nAnother change thats been put in place is we lock the super mirror\u0027s in the\npinned extent map in order to keep us from adding that stuff as free space when\ncaching the block group.  This doesn\u0027t really change anything else as far as the\npinned extent map is concerned, since for actual pinned extents we use\nEXTENT_DIRTY, but it does mean that when we unmount we have to go in and unlock\nthose extents to keep from leaking memory.\n\nI\u0027ve also added a check where when we are reading block groups from disk, if the\namount of space used \u003d\u003d the size of the block group, we go ahead and mark the\nblock group as cached.  This drastically reduces the amount of time it takes to\ncache the block groups.  Using the same test as above, except doing a dd to a\nfile and then unmounting, it used to take 33 seconds to umount, now it takes 3\nseconds.\n\nThis version uses the commit_root in the caching kthread, and then keeps track\nof how many async caching threads are running at any given time so if one of the\nasync threads is still running as we cross transactions we can wait until its\nfinished before handling the pinned extents.  Thank you,\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "963030817060e4f109be1993b9ae8f81dbf5e11a",
      "tree": "7d81121b7e68d3d5b3317afba53d36bc1bf8221a",
      "parents": [
        "83121942b28daffc9526b14b7843d8cdbd3db641"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "josef@redhat.com",
        "time": "Mon Jul 13 21:29:25 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jul 24 09:23:30 2009 -0400"
      },
      "message": "Btrfs: use hybrid extents+bitmap rb tree for free space\n\nCurrently btrfs has a problem where it can use a ridiculous amount of RAM simply\ntracking free space.  As free space gets fragmented, we end up with thousands of\nentries on an rb-tree per block group, which usually spans 1 gig of area.  Since\nwe currently don\u0027t ever flush free space cache back to disk this gets to be a\nbit unweildly on large fs\u0027s with lots of fragmentation.\n\nThis patch solves this problem by using PAGE_SIZE bitmaps for parts of the free\nspace cache.  Initially we calculate a threshold of extent entries we can\nhandle, which is however many extent entries we can cram into 16k of ram.  The\nmaximum amount of RAM that should ever be used to track 1 gigabyte of diskspace\nwill be 32k of RAM, which scales much better than we did before.\n\nOnce we pass the extent threshold, we start adding bitmaps and using those\ninstead for tracking the free space.  This patch also makes it so that any free\nspace thats less than 4 * sectorsize we go ahead and put into a bitmap.  This is\nnice since we try and allocate out of the front of a block group, so if the\nfront of a block group is heavily fragmented and then has a huge chunk of free\nspace at the end, we go ahead and add the fragmented areas to bitmaps and use a\nnormal extent entry to track the big chunk at the back of the block group.\n\nI\u0027ve also taken the opportunity to revamp how we search for free space.\nPreviously we indexed free space via an offset indexed rb tree and a bytes\nindexed rb tree.  I\u0027ve dropped the bytes indexed rb tree and use only the offset\nindexed rb tree.  This cuts the number of tree operations we were doing\npreviously down by half, and gives us a little bit of a better allocation\npattern since we will always start from a specific offset and search forward\nfrom there, instead of searching for the size we need and try and get it as\nclose as possible to the offset we want.\n\nI\u0027ve given this a healthy amount of testing pre-new format stuff, as well as\npost-new format stuff.  I\u0027ve booted up my fedora box which is installed on btrfs\nwith this patch and ran with it for a few days without issues.  I\u0027ve not seen\nany performance regressions in any of my tests.\n\nSince the last patch Yan Zheng fixed a problem where we could have overlapping\nentries, so updating their offset inline would cause problems.  Thanks,\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "4a8c9a62d7f7f058eed4b8a6f2c890a887778093",
      "tree": "d3d099197e5ddc94f737dbad273810b902b05307",
      "parents": [
        "33c66f430bfa3a033e70470e4c93f967156b696d"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Wed Jul 22 10:07:05 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Jul 22 10:07:05 2009 -0400"
      },
      "message": "Btrfs: make sure all dirty blocks are written at commit time\n\nWrite dirty block groups may allocate new block, and so may add new delayed\nback ref. btrfs_run_delayed_refs may make some block groups dirty.\n\ncommit_cowonly_roots does not handle the recursion properly, and some dirty\nblocks can be left unwritten at commit time. This patch moves\nbtrfs_run_delayed_refs into the loop that writes dirty block groups, and makes\nthe code not break out of the loop until there are no dirty block groups or\ndelayed back refs.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "68f5a38c3ea4ae9cc7a40f86ff6d6d031583d93a",
      "tree": "bc409be7ea8e4da6fa6b9d6d97d0af715aa982f9",
      "parents": [
        "9b627e9bf49ebfeb060dfae0435bdba06cf27cb8"
      ],
      "author": {
        "name": "Hu Tao",
        "email": "cnhutao@gmail.com",
        "time": "Thu Jul 02 13:55:45 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jul 02 13:55:45 2009 -0400"
      },
      "message": "Btrfs: fix error message formatting\n\nMake an error msg look nicer by inserting a space between number and word.\n\nSigned-off-by: Hu Tao \u003chu.taoo@gmail.com\u003e\nSigned-off-by: Jiri Kosina \u003cjkosina@suse.cz\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "2c47e605a91dde6b0514f689645e7ab336c8592a",
      "tree": "d541e61440f06f37d17e2d14cbaa78fc0cd41ff2",
      "parents": [
        "a970b0a16cc416a509d5ae8b1d70978664e6f4fe"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Sat Jun 27 21:07:35 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jul 02 13:41:17 2009 -0400"
      },
      "message": "Btrfs: update backrefs while dropping snapshot\n\nThe new backref format has restriction on type of backref item.  If a tree\nblock isn\u0027t referenced by its owner tree, full backrefs must be used for the\npointers in it. When a tree block loses its owner tree\u0027s reference, backrefs\nfor the pointers in it should be updated to full backrefs. Current\nbtrfs_drop_snapshot misses the code that updates backrefs, so it\u0027s unsafe for\ngeneral use.\n\nThis patch adds backrefs update code to btrfs_drop_snapshot.  It isn\u0027t a\nproblem in the restricted form btrfs_drop_snapshot is used today, but for\ngeneral snapshot deletion this update is required.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "85d4198e40c289dd623cecd16601fa613559bed7",
      "tree": "8f76a9567063bded47b69f2f39d557307cdf5b54",
      "parents": [
        "fd0fb038d5a308c7faddd1701be5e70aaffec98b"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Jun 11 08:51:10 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jun 11 08:51:34 2009 -0400"
      },
      "message": "Btrfs: check duplicate backrefs for both data and metadata\n\nlookup_inline_extent_backref only checks for duplicate backref for data\nextents. It assumes backrefs for tree block never conflict.\n\nThis patch makes lookup_inline_extent_backref check for duplicate backrefs\nfor both data and tree block, so that we can detect potential bug earlier.\nThis is a safety check, strictly speaking it is not required.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "163e783e6a8b1e8bcb4c9084d438091386b589df",
      "tree": "dd7fbe662b7c81ba8c548b309fed4376f07ea495",
      "parents": [
        "6cbff00f4632c8060b06bfc9585805217f11e12e"
      ],
      "author": {
        "name": "David Woodhouse",
        "email": "dwmw2@infradead.org",
        "time": "Sun Apr 19 13:02:41 2009 +0100"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Jun 10 11:29:53 2009 -0400"
      },
      "message": "Btrfs: remove crc32c.h and use libcrc32c directly.\n\nThere\u0027s no need to preserve this abstraction; it used to let us use\nhardware crc32c support directly, but libcrc32c is already doing that for us\nthrough the crypto API -- so we\u0027re already using the Intel crc32c\nacceleration where appropriate.\n\nSigned-off-by: David Woodhouse \u003cDavid.Woodhouse@intel.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "451d7585a8bb1b9bec0d676ce3dece1923164e55",
      "tree": "b4e9103b7010e45e02deff9ae4470df71475f8de",
      "parents": [
        "c604480171c510c1beeb81b82418e5bc4de8f1ae"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Jun 09 20:28:34 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Jun 10 11:29:52 2009 -0400"
      },
      "message": "Btrfs: add mount -o ssd_spread to spread allocations out\n\nSome SSDs perform best when reusing block numbers often, while\nothers perform much better when clustering strictly allocates\nbig chunks of unused space.\n\nThe default mount -o ssd will find rough groupings of blocks\nwhere there are a bunch of free blocks that might have some\nallocated blocks mixed in.\n\nmount -o ssd_spread will make sure there are no allocated blocks\nmixed in.  It should perform better on lower end SSDs.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "5d4f98a28c7d334091c1b7744f48a1acdd2a4ae0",
      "tree": "c611d7d824cbcdb777dd2d8e33e2ed1c5df8a9c6",
      "parents": [
        "5c939df56c3ea018b58e5aa76181284c2053d699"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Wed Jun 10 10:45:14 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Jun 10 11:29:46 2009 -0400"
      },
      "message": "Btrfs: Mixed back reference  (FORWARD ROLLING FORMAT CHANGE)\n\nThis commit introduces a new kind of back reference for btrfs metadata.\nOnce a filesystem has been mounted with this commit, IT WILL NO LONGER\nBE MOUNTABLE BY OLDER KERNELS.\n\nWhen a tree block in subvolume tree is cow\u0027d, the reference counts of all\nextents it points to are increased by one.  At transaction commit time,\nthe old root of the subvolume is recorded in a \"dead root\" data structure,\nand the btree it points to is later walked, dropping reference counts\nand freeing any blocks where the reference count goes to 0.\n\nThe increments done during cow and decrements done after commit cancel out,\nand the walk is a very expensive way to go about freeing the blocks that\nare no longer referenced by the new btree root.  This commit reduces the\ntransaction overhead by avoiding the need for dead root records.\n\nWhen a non-shared tree block is cow\u0027d, we free the old block at once, and the\nnew block inherits old block\u0027s references. When a tree block with reference\ncount \u003e 1 is cow\u0027d, we increase the reference counts of all extents\nthe new block points to by one, and decrease the old block\u0027s reference count by\none.\n\nThis dead tree avoidance code removes the need to modify the reference\ncounts of lower level extents when a non-shared tree block is cow\u0027d.\nBut we still need to update back ref for all pointers in the block.\nThis is because the location of the block is recorded in the back ref\nitem.\n\nWe can solve this by introducing a new type of back ref. The new\nback ref provides information about pointer\u0027s key, level and in which\ntree the pointer lives. This information allow us to find the pointer\nby searching the tree. The shortcoming of the new back ref is that it\nonly works for pointers in tree blocks referenced by their owner trees.\n\nThis is mostly a problem for snapshots, where resolving one of these\nfuzzy back references would be O(number_of_snapshots) and quite slow.\nThe solution used here is to use the fuzzy back references in the common\ncase where a given tree block is only referenced by one root,\nand use the full back references when multiple roots have a reference\non a given block.\n\nThis commit adds per subvolume red-black tree to keep trace of cached\ninodes. The red-black tree helps the balancing code to find cached\ninodes whose inode numbers within a given range.\n\nThis commit improves the balancing code by introducing several data\nstructures to keep the state of balancing. The most important one\nis the back ref cache. It caches how the upper level tree blocks are\nreferenced. This greatly reduce the overhead of checking back ref.\n\nThe improved balancing code scales significantly better with a large\nnumber of snapshots.\n\nThis is a very large commit and was written in a number of\npieces.  But, they depend heavily on the disk format change and were\nsquashed together to make sure git bisect didn\u0027t end up in a\nbad state wrt space balancing or the format change.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "44fb5511638938a2c37c895abc14df648ffc07e9",
      "tree": "0554a8a71403958b279ddcb601a3d0bb85943a59",
      "parents": [
        "2cc3c559fb2fe8cecca82a517bc56e88b0c1effd"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jun 04 15:34:51 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Jun 04 15:41:27 2009 -0400"
      },
      "message": "Btrfs: Fix oops and use after free during space balancing\n\nThe btrfs allocator uses list_for_each to walk the available block\ngroups when searching for free blocks.  It starts off with a hint\nto help find the best block group for a given allocation.\n\nThe hint is resolved into a block group, but we don\u0027t properly check\nto make sure the block group we find isn\u0027t in the middle of being\nfreed due to filesystem shrinking or balancing.  If it is being\nfreed, the list pointers in it are bogus and can\u0027t be trusted.  But,\nthe code happily goes along and uses them in the list_for_each loop,\nleading to all kinds of fun.\n\nThe fix used here is to check to make sure the block group we find really\nis on the list before we use it.  list_del_init is used when removing\nit from the list, so we can do a proper check.\n\nThe allocation clustering code has a similar bug where it will trust\nthe block group in the current free space cluster.  If our allocation\nflags have changed (going from single spindle dup to raid1 for example)\nbecause the drives in the FS have changed, we\u0027re not allowed to use\nthe old block group any more.\n\nThe fix used here is to check the current cluster against the\ncurrent allocation flags.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "9f55684c2d9869e8cc53595a3fee679958511cfb",
      "tree": "67f9b0af9e1533d84ade000ef2daee50cbf71f94",
      "parents": [
        "6b65c5c61bf86086817a5ed786c8f45755ac83b3"
      ],
      "author": {
        "name": "Sankar P",
        "email": "sankar.curiosity@gmail.com",
        "time": "Thu May 14 13:52:22 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu May 14 14:00:34 2009 -0400"
      },
      "message": "Btrfs: Spelling fix in btrfs_lookup_first_block_group comments\n\nSigned-off-by: Sankar P \u003csankar.curiosity@gmail.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "21380931eb4da4e29ac663d0221581282cbba208",
      "tree": "fa8c2155784ccb0ee996e52e75d1e04b79cf2560",
      "parents": [
        "e63b6a6c0ffa2ebd8617cc1a10969000296831aa"
      ],
      "author": {
        "name": "Joel Becker",
        "email": "joel.becker@oracle.com",
        "time": "Tue Apr 21 12:38:29 2009 -0700"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Apr 27 08:37:49 2009 -0400"
      },
      "message": "Btrfs: Fix a bunch of printk() warnings.\n\nJust happened to notice a bunch of %llu vs u64 warnings.  Here\u0027s a patch\nto cast them all.\n\nSigned-off-by: Joel Becker \u003cjoel.becker@oracle.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "97e728d4353f38c87bf0804cdfd79a9b13fc2c3e",
      "tree": "853d3317ff1476e4ad28921265e28b4919196304",
      "parents": [
        "546888da82082555a56528730a83f0afd12f33bf"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Tue Apr 21 17:40:57 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 24 15:46:02 2009 -0400"
      },
      "message": "Btrfs: try to keep a healthy ratio of metadata vs data block groups\n\nThis patch makes the chunk allocator keep a good ratio of metadata vs data\nblock groups.  By default for every 8 data block groups, we\u0027ll allocate 1\nmetadata chunk, or about 12% of the disk will be allocated for metadata.  This\ncan be changed by specifying the metadata_ratio mount option.\n\nThis is simply the number of data block groups that have to be allocated to\nforce a metadata chunk allocation.  By making sure we allocate metadata chunks\nmore often, we are less likely to get into situations where the whole disk\nhas been allocated as data block groups.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "fa9c0d795f7b57c76560b7fac703f5d341210e28",
      "tree": "74d9d9846e21ce5b99738f3cc13b855fb63d1eba",
      "parents": [
        "8e73f275011b3264a87339fd9f1690e944e381c9"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 03 09:47:43 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 03 09:47:43 2009 -0400"
      },
      "message": "Btrfs: rework allocation clustering\n\nBecause btrfs is copy-on-write, we end up picking new locations for\nblocks very often.  This makes it fairly difficult to maintain perfect\nread patterns over time, but we can at least do some optimizations\nfor writes.\n\nThis is done today by remembering the last place we allocated and\ntrying to find a free space hole big enough to hold more than just one\nallocation.  The end result is that we tend to write sequentially to\nthe drive.\n\nThis happens all the time for metadata and it happens for data\nwhen mounted -o ssd.  But, the way we record it is fairly racey\nand it tends to fragment the free space over time because we are trying\nto allocate fairly large areas at once.\n\nThis commit gets rid of the races by adding a free space cluster object\nwith dedicated locking to make sure that only one process at a time\nis out replacing the cluster.\n\nThe free space fragmentation is somewhat solved by allowing a cluster\nto be comprised of smaller free space extents.  This part definitely\nadds some CPU time to the cluster allocations, but it allows the allocator\nto consume the small holes left behind by cow.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n\n"
    },
    {
      "commit": "04018de5d41e6490840de9399e029fd30e78576f",
      "tree": "4fcb979cee830884ca0d3f9636cc70ed17b3364a",
      "parents": [
        "6226cb0a5ea3f6289883753c15d53f48a6c6bbfb"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Fri Apr 03 10:14:18 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 03 10:14:18 2009 -0400"
      },
      "message": "Btrfs: kill the pinned_mutex\n\nThis patch removes the pinned_mutex.  The extent io map has an internal tree\nlock that protects the tree itself, and since we only copy the extent io map\nwhen we are committing the transaction we don\u0027t need it there.  We also don\u0027t\nneed it when caching the block group since searching through the tree is also\nprotected by the internal map spin lock.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n"
    },
    {
      "commit": "6226cb0a5ea3f6289883753c15d53f48a6c6bbfb",
      "tree": "819765cd5a5816017580f638c4b2a3e7f6354aea",
      "parents": [
        "2552d17e328044d1811cae733087a1fb9aac2eb6"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Fri Apr 03 10:14:18 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 03 10:14:18 2009 -0400"
      },
      "message": "Btrfs: kill the block group alloc mutex\n\nThis patch removes the block group alloc mutex used to protect the free space\ntree for allocations and replaces it with a spin lock which is used only to\nprotect the free space rb tree.  This means we only take the lock when we are\ndirectly manipulating the tree, which makes us a touch faster with\nmulti-threaded workloads.\n\nThis patch also gets rid of btrfs_find_free_space and replaces it with\nbtrfs_find_space_for_alloc, which takes the number of bytes you want to\nallocate, and empty_size, which is used to indicate how much free space should\nbe at the end of the allocation.\n\nIt will return an offset for the allocator to use.  If we don\u0027t end up using it\nwe _must_ call btrfs_add_free_space to put it back.  This is the tradeoff to\nkill the alloc_mutex, since we need to make sure nobody else comes along and\ntakes our space.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n"
    },
    {
      "commit": "2552d17e328044d1811cae733087a1fb9aac2eb6",
      "tree": "21101d10ccfa4f44d150bc570c2080160e332305",
      "parents": [
        "70cb074345832b75cf422ed729706345511773b3"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Fri Apr 03 10:14:19 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 03 10:14:19 2009 -0400"
      },
      "message": "Btrfs: clean up find_free_extent\n\nI\u0027ve replaced the strange looping constructs with a list_for_each_entry on\nspace_info-\u003eblock_groups.  If we have a hint we just jump into the loop with\nthe block group and start looking for space.  If we don\u0027t find anything we\nstart at the beginning and start looking.  We never come out of the loop with a\nref on the block_group _unless_ we found space to use, then we drop it after we\nset the trans block_group.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n"
    },
    {
      "commit": "70cb074345832b75cf422ed729706345511773b3",
      "tree": "37f23796751a20feff12f935568d4f5fff33b3fc",
      "parents": [
        "bedf762ba3a4b70295661fa70c29c1f18fe0f351"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Fri Apr 03 10:14:19 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Apr 03 10:14:19 2009 -0400"
      },
      "message": "Btrfs: free space cache cleanups\n\nThis patch cleans up the free space cache code a bit.  It better documents the\nidiosyncrasies of tree_search_offset and makes the code make a bit more sense.\nI took out the info allocation at the start of __btrfs_add_free_space and put it\nwhere it makes more sense.  This was left over cruft from when alloc_mutex\nexisted.  Also all of the re-searches we do to make sure we inserted properly.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n"
    },
    {
      "commit": "d57e62b89796f751c9422801cbcd407a9f8dcdc4",
      "tree": "353960256ddf5f92aa391a2ea570bea1d2d11fa8",
      "parents": [
        "5a3f23d515a2ebf0c750db80579ca57b28cbce6d"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 31 13:47:50 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 31 14:27:58 2009 -0400"
      },
      "message": "Btrfs: try to free metadata pages when we free btree blocks\n\nCOW means we cycle though blocks fairly quickly, and once we\nfree an extent on disk, it doesn\u0027t make much sense to keep the pages around.\n\nThis commit tries to immediately free the page when we free the extent,\nwhich lowers our memory footprint significantly.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "12fcfd22fe5bf4fe74710232098bc101af497995",
      "tree": "b01ba82147ea76c89149e54d475ed97121387261",
      "parents": [
        "a74ac3220774d33db967088906dc3351829e2d3a"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 10:24:20 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 16:14:52 2009 -0400"
      },
      "message": "Btrfs: tree logging unlink/rename fixes\n\nThe tree logging code allows individual files or directories to be logged\nwithout including operations on other files and directories in the FS.\nIt tries to commit the minimal set of changes to disk in order to\nfsync the single file or directory that was sent to fsync or O_SYNC.\n\nThe tree logging code was allowing files and directories to be unlinked\nif they were part of a rename operation where only one directory\nin the rename was in the fsync log.  This patch adds a few new rules\nto the tree logging.\n\n1) on rename or unlink, if the inode being unlinked isn\u0027t in the fsync\nlog, we must force a full commit before doing an fsync of the directory\nwhere the unlink was done.  The commit isn\u0027t done during the unlink,\nbut it is forced the next time we try to log the parent directory.\n\nSolution: record transid of last unlink/rename per directory when the\ndirectory wasn\u0027t already logged.  For renames this is only done when\nrenaming to a different directory.\n\nmkdir foo/some_dir\nnormal commit\nrename foo/some_dir foo2/some_dir\nmkdir foo/some_dir\nfsync foo/some_dir/some_file\n\nThe fsync above will unlink the original some_dir without recording\nit in its new location (foo2).  After a crash, some_dir will be gone\nunless the fsync of some_file forces a full commit\n\n2) we must log any new names for any file or dir that is in the fsync\nlog.  This way we make sure not to lose files that are unlinked during\nthe same transaction.\n\n2a) we must log any new names for any file or dir during rename\nwhen the directory they are being removed from was logged.\n\n2a is actually the more important variant.  Without the extra logging\na crash might unlink the old name without recreating the new one\n\n3) after a crash, we must go through any directories with a link count\nof zero and redo the rm -rf\n\nmkdir f1/foo\nnormal commit\nrm -rf f1/foo\nfsync(f1)\n\nThe directory f1 was fully removed from the FS, but fsync was never\ncalled on f1, only its parent dir.  After a crash the rm -rf must\nbe replayed.  This must be able to recurse down the entire\ndirectory tree.  The inode link count fixup code takes care of the\nugly details.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "b9473439d3e84d9fc1a0a83faca69cc1b7566341",
      "tree": "bef8321b80589026b617d61d0fabaf545d459269",
      "parents": [
        "89573b9c516b24af8a3b9958dd5afca8fa874e3d"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Mar 13 11:00:37 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 16:14:28 2009 -0400"
      },
      "message": "Btrfs: leave btree locks spinning more often\n\nbtrfs_mark_buffer dirty would set dirty bits in the extent_io tree\nfor the buffers it was dirtying.  This may require a kmalloc and it\nwas not atomic.  So, anyone who called btrfs_mark_buffer_dirty had to\nset any btree locks they were holding to blocking first.\n\nThis commit changes dirty tracking for extent buffers to just use a flag\nin the extent buffer.  Now that we have one and only one extent buffer\nper page, this can be safely done without losing dirty bits along the way.\n\nThis also introduces a path-\u003eleave_spinning flag that callers of\nbtrfs_search_slot can use to indicate they will properly deal with a\npath returned where all the locks are spinning instead of blocking.\n\nMany of the btree search callers now expect spinning paths,\nresulting in better btree concurrency overall.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "b7ec40d7845bffca8bb3af2ea3f192d6257bbe21",
      "tree": "65b833b979417d36f0fd26d647573de1df0646b9",
      "parents": [
        "c3e69d58e86c3917ae4e9e31b4acf490a7cafe60"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Mar 12 20:12:45 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 16:14:26 2009 -0400"
      },
      "message": "Btrfs: reduce stalls during transaction commit\n\nTo avoid deadlocks and reduce latencies during some critical operations, some\ntransaction writers are allowed to jump into the running transaction and make\nit run a little longer, while others sit around and wait for the commit to\nfinish.\n\nThis is a bit unfair, especially when the callers that jump in do a bunch\nof IO that makes all the others procs on the box wait.  This commit\nreduces the stalls this produces by pre-reading file extent pointers\nduring btrfs_finish_ordered_io before the transaction is joined.\n\nIt also tunes the drop_snapshot code to politely wait for transactions\nthat have started writing out their delayed refs to finish.  This avoids\nnew delayed refs being flooded into the queue while we\u0027re trying to\nclose off the transaction.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "c3e69d58e86c3917ae4e9e31b4acf490a7cafe60",
      "tree": "bd4f1e62446a208bdae26f0c36d67e3afbc1cd1d",
      "parents": [
        "1887be66dcc3140a81d1299958a41fc0eedfa64f"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Mar 13 10:17:05 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 16:14:26 2009 -0400"
      },
      "message": "Btrfs: process the delayed reference queue in clusters\n\nThe delayed reference queue maintains pending operations that need to\nbe done to the extent allocation tree.  These are processed by\nfinding records in the tree that are not currently being processed one at\na time.\n\nThis is slow because it uses lots of time searching through the rbtree\nand because it creates lock contention on the extent allocation tree\nwhen lots of different procs are running delayed refs at the same time.\n\nThis commit changes things to grab a cluster of refs for processing,\nusing a cursor into the rbtree as the starting point of the next search.\nThis way we walk smoothly through the rbtree.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "1887be66dcc3140a81d1299958a41fc0eedfa64f",
      "tree": "3f0666948a83c48c77e0c37dca1c71a6aff9eb1d",
      "parents": [
        "44871b1b24b593996db43495cf4484cc580bdc10"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Mar 13 10:11:24 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 16:14:26 2009 -0400"
      },
      "message": "Btrfs: try to cleanup delayed refs while freeing extents\n\nWhen extents are freed, it is likely that we\u0027ve removed the last\ndelayed reference update for the extent.  This checks the delayed\nref tree when things are freed, and if no ref updates area left it\nimmediately processes the delayed ref.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "56bec294dea971335d4466b30f2d959f28f6e36d",
      "tree": "fc0b5bbf4bb6ab35582a4c7f58f5ac88f71c38bf",
      "parents": [
        "9fa8cfe706f9c20067c042a064999d5825a35330"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Mar 13 10:10:06 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 24 16:14:25 2009 -0400"
      },
      "message": "Btrfs: do extent allocation and reference count updates in the background\n\nThe extent allocation tree maintains a reference count and full\nback reference information for every extent allocated in the\nfilesystem.  For subvolume and snapshot trees, every time\na block goes through COW, the new copy of the block adds a reference\non every block it points to.\n\nIf a btree node points to 150 leaves, then the COW code needs to go\nand add backrefs on 150 different extents, which might be spread all\nover the extent allocation tree.\n\nThese updates currently happen during btrfs_cow_block, and most COWs\nhappen during btrfs_search_slot.  btrfs_search_slot has locks held\non both the parent and the node we are COWing, and so we really want\nto avoid IO during the COW if we can.\n\nThis commit adds an rbtree of pending reference count updates and extent\nallocations.  The tree is ordered by byte number of the extent and byte number\nof the parent for the back reference.  The tree allows us to:\n\n1) Modify back references in something close to disk order, reducing seeks\n2) Significantly reduce the number of modifications made as block pointers\nare balanced around\n3) Do all of the extent insertion and back reference modifications outside\nof the performance critical btrfs_search_slot code.\n\n#3 has the added benefit of greatly reducing the btrfs stack footprint.\nThe extent allocation tree modifications are done without the deep\n(and somewhat recursive) call chains used in the past.\n\nThese delayed back reference updates must be done before the transaction\ncommits, and so the rbtree is tied to the transaction.  Throttling is\nimplemented to help keep the queue of backrefs at a reasonable size.\n\nSince there was a similar mechanism in place for the extent tree\nextents, that is removed and replaced by the delayed reference tree.\n\nYan Zheng \u003cyan.zheng@oracle.com\u003e helped review and fixup this code.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "4184ea7f908d95f329febc3665cf66da8568b467",
      "tree": "ef16aabf4604c9c1aba23e222ff7fb4510052ebb",
      "parents": [
        "b9447ef80bd301b932ac4d85c9622e929de5fd62"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 10 12:39:20 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Tue Mar 10 12:39:20 2009 -0400"
      },
      "message": "Btrfs: Fix locking around adding new space_info\n\nStorage allocated to different raid levels in btrfs is tracked by\na btrfs_space_info structure, and all of the current space_infos are\ncollected into a list_head.\n\nMost filesystems have 3 or 4 of these structs total, and the list is\nonly changed when new raid levels are added or at unmount time.\n\nThis commit adds rcu locking on the list head, and properly frees\nthings at unmount time.  It also clears the space_info-\u003efull flag\nwhenever new space is added to the FS.\n\nThe locking for the space info list goes like this:\n\nreads: protected by rcu_read_lock()\nwrites: protected by the chunk_mutex\n\nAt unmount time we don\u0027t need special locking because all the readers\nare gone.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n\n"
    },
    {
      "commit": "b9447ef80bd301b932ac4d85c9622e929de5fd62",
      "tree": "6d0bb1f287ed09f7850b77e2f622c3bebb35112b",
      "parents": [
        "4e06bdd6cbd5105376e7caf4e683ed131e777389"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Mar 09 11:45:38 2009 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Mar 09 11:45:38 2009 -0400"
      },
      "message": "Btrfs: fix spinlock assertions on UP systems\n\nbtrfs_tree_locked was being used to make sure a given extent_buffer was\nproperly locked in a few places.  But, it wasn\u0027t correct for UP compiled\nkernels.\n\nThis switches it to using assert_spin_locked instead, and renames it to\nbtrfs_assert_tree_locked to better reflect how it was really being used.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "4e06bdd6cbd5105376e7caf4e683ed131e777389",
      "tree": "20a7b891f7f8f518eb2cd81234e0c9ab5902c6c3",
      "parents": [
        "6a63209fc02d5483371f07e4913ee8abad608051"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Fri Feb 20 10:59:53 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Feb 20 10:59:53 2009 -0500"
      },
      "message": "Btrfs: try committing transaction before returning ENOSPC\n\nThis fixes a problem where we could return -ENOSPC when we may actually have\nplenty of space, the space is just pinned.  Instead of returning -ENOSPC\nimmediately, commit the transaction first and then try and do the allocation\nagain.\n\nThis patch also does chunk allocation for metadata if we pass the 80%\nthreshold for metadata space.  This will help with stack usage since the chunk\nallocation will happen early on, instead of when the allocation is happening.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n\n"
    },
    {
      "commit": "6a63209fc02d5483371f07e4913ee8abad608051",
      "tree": "7595e0df452928b677b66a64baf0cb3b7ec53dfc",
      "parents": [
        "2cfbd50b536c878e58ab3681c4e944fa3d99b415"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Fri Feb 20 11:00:09 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Feb 20 11:00:09 2009 -0500"
      },
      "message": "Btrfs: add better -ENOSPC handling\n\nThis is a step in the direction of better -ENOSPC handling.  Instead of\nchecking the global bytes counter we check the space_info bytes counters to\nmake sure we have enough space.\n\nIf we don\u0027t we go ahead and try to allocate a new chunk, and then if that fails\nwe return -ENOSPC.  This patch adds two counters to btrfs_space_info,\nbytes_delalloc and bytes_may_use.\n\nbytes_delalloc account for extents we\u0027ve actually setup for delalloc and will\nbe allocated at some point down the line. \n\nbytes_may_use is to keep track of how many bytes we may use for delalloc at\nsome point.  When we actually set the extent_bit for the delalloc bytes we\nsubtract the reserved bytes from the bytes_may_use counter.  This keeps us from\nnot actually being able to allocate space for any delalloc bytes.\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n\n\n\n"
    },
    {
      "commit": "2456242530a21cfee82646ebeeda65d3f74faa4c",
      "tree": "c0e8f5eda96cefeb44a48f05a248ea22b4259ad2",
      "parents": [
        "4008c04a07c73ec3cb1be4c1391d2159a8f75d6d"
      ],
      "author": {
        "name": "Yan Zheng",
        "email": "zheng.yan@oracle.com",
        "time": "Thu Feb 12 14:14:53 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 12 14:14:53 2009 -0500"
      },
      "message": "Btrfs: hold trans_mutex when using btrfs_record_root_in_trans\n\nbtrfs_record_root_in_trans needs the trans_mutex held to make sure two\ncallers don\u0027t race to setup the root in a given transaction.  This adds\nit to all the places that were missing it.\n\nSigned-off-by: Yan Zheng \u003czheng.yan@oracle.com\u003e\n\n"
    },
    {
      "commit": "4008c04a07c73ec3cb1be4c1391d2159a8f75d6d",
      "tree": "c0b10a7287ac810bfc406541e32b850ad4580248",
      "parents": [
        "3f3420df505e47751ef76a652b5cb660e5360d6f"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 12 14:09:45 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 12 14:09:45 2009 -0500"
      },
      "message": "Btrfs: make a lockdep class for the extent buffer locks\n\nBtrfs is currently using spin_lock_nested with a nested value based\non the tree depth of the block.  But, this doesn\u0027t quite work because\nthe max tree depth is bigger than what spin_lock_nested can deal with,\nand because locks are sometimes taken before the level field is filled in.\n\nThe solution here is to use lockdep_set_class_and_name instead, and to\nset the class before unlocking the pages when the block is read from the\ndisk and just after init of a freshly allocated tree block.\n\nbtrfs_clear_path_blocking is also changed to take the locks in the proper\norder, and it also makes sure all the locks currently held are properly\nset to blocking before it tries to retake the spinlocks.  Otherwise, lockdep\ngets upset about bad lock orderin.\n\nThe lockdep magic cam from Peter Zijlstra \u003cpeterz@infradead.org\u003e\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "536ac8ae86e68bb5574d7cc81c7d229a86b82601",
      "tree": "2ec565edbbe3cf91e864b83f3fbd0a5bf8c088c4",
      "parents": [
        "b288052e1779261ae80138074989ef50358c4e58"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 12 09:41:38 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 12 09:41:38 2009 -0500"
      },
      "message": "Btrfs: use larger metadata clusters in ssd mode\n\nLarger metadata clusters can significantly improve writeback performance\non ssd drives with large erasure blocks.  The larger clusters make it\nmore likely a given IO will completely overwrite the ssd block, so it\ndoesn\u0027t have to do an internal rwm cycle.\n\nOn spinning media, lager metadata clusters end up spreading out the\nmetadata more over time, which makes fsck slower, so we don\u0027t want this\nto be the default.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n\n"
    },
    {
      "commit": "eb099670895f22970cd143875467c2768d6d87e5",
      "tree": "4fc48dad8f0f2c13ff85d9310aa163305a243ef2",
      "parents": [
        "284b066af41579f62649048fdec5c5e7091703e6"
      ],
      "author": {
        "name": "Josef Bacik",
        "email": "jbacik@redhat.com",
        "time": "Thu Feb 12 09:27:38 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 12 09:27:38 2009 -0500"
      },
      "message": "Btrfs: make sure all pending extent operations are complete\n\nTheres a slight problem with finish_current_insert, if we set all to 1 and then\ngo through and don\u0027t actually skip any of the extents on the pending list, we\ncould exit right after we\u0027ve added new extents.\n\nThis is a problem because by inserting the new extents we could have gotten new\nCOW\u0027s to happen and such, so we may have some pending updates to do or even\nmore inserts to do after that.\n\nSo this patch will only exit if we have never skipped any of the extents in the\npending list, and we have no extents to insert, this will make sure that all of\nthe pending work is truly done before we return.  I\u0027ve been running with this\npatch for a few days with all of my other testing and have not seen issues.\nThanks,\n\nSigned-off-by: Josef Bacik \u003cjbacik@redhat.com\u003e\n\n"
    },
    {
      "commit": "806638bce99f51deccbfedbe86ab3c5cf55a1d35",
      "tree": "86e53bb492274a9e20f515220b737e71b6397b86",
      "parents": [
        "9b0d3ace33ef225690a86d7130feadb22367f496"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 05 09:08:14 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Thu Feb 05 09:08:14 2009 -0500"
      },
      "message": "Btrfs: Fix memory leak in cache_drop_leaf_ref\n\nThe code wasn\u0027t doing a kfree on the sorted array\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "bd56b30205bc09da0beb80d4ba3d4c7309792da5",
      "tree": "a5cb3104687b27e923b73b2840f053abc1229a92",
      "parents": [
        "b4ce94de9b4d64e8ab3cf155d13653c666e22b9b"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Feb 04 09:27:02 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Feb 04 09:27:02 2009 -0500"
      },
      "message": "Btrfs: Make btrfs_drop_snapshot work in larger and more efficient chunks\n\nEvery transaction in btrfs creates a new snapshot, and then schedules the\nsnapshot from the last transaction for deletion.  Snapshot deletion\nworks by walking down the btree and dropping the reference counts\non each btree block during the walk.\n\nIf if a given leaf or node has a reference count greater than one,\nthe reference count is decremented and the subtree pointed to by that\nnode is ignored.\n\nIf the reference count is one, walking continues down into that node\nor leaf, and the references of everything it points to are decremented.\n\nThe old code would try to work in small pieces, walking down the tree\nuntil it found the lowest leaf or node to free and then returning.  This\nwas very friendly to the rest of the FS because it didn\u0027t have a huge\nimpact on other operations.\n\nBut it wouldn\u0027t always keep up with the rate that new commits added new\nsnapshots for deletion, and it wasn\u0027t very optimal for the extent\nallocation tree because it wasn\u0027t finding leaves that were close together\non disk and processing them at the same time.\n\nThis changes things to walk down to a level 1 node and then process it\nin bulk.  All the leaf pointers are sorted and the leaves are dropped\nin order based on their extent number.\n\nThe extent allocation tree and commit code are now fast enough for\nthis kind of bulk processing to work without slowing the rest of the FS\ndown.  Overall it does less IO and is better able to keep up with\nsnapshot deletions under high load.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "b4ce94de9b4d64e8ab3cf155d13653c666e22b9b",
      "tree": "ebc44a9554a50b495b091cb0979d79fd29e50fe7",
      "parents": [
        "c487685d7c18a8481900755aa5c56a7a74193101"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Feb 04 09:25:08 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Feb 04 09:25:08 2009 -0500"
      },
      "message": "Btrfs: Change btree locking to use explicit blocking points\n\nMost of the btrfs metadata operations can be protected by a spinlock,\nbut some operations still need to schedule.\n\nSo far, btrfs has been using a mutex along with a trylock loop,\nmost of the time it is able to avoid going for the full mutex, so\nthe trylock loop is a big performance gain.\n\nThis commit is step one for getting rid of the blocking locks entirely.\nbtrfs_tree_lock takes a spinlock, and the code explicitly switches\nto a blocking lock when it starts an operation that can schedule.\n\nWe\u0027ll be able get rid of the blocking locks in smaller pieces over time.\nTracing allows us to find the most common cause of blocking, so we\ncan start with the hot spots first.\n\nThe basic idea is:\n\nbtrfs_tree_lock() returns with the spin lock held\n\nbtrfs_set_lock_blocking() sets the EXTENT_BUFFER_BLOCKING bit in\nthe extent buffer flags, and then drops the spin lock.  The buffer is\nstill considered locked by all of the btrfs code.\n\nIf btrfs_tree_lock gets the spinlock but finds the blocking bit set, it drops\nthe spin lock and waits on a wait queue for the blocking bit to go away.\n\nMuch of the code that needs to set the blocking bit finishes without actually\nblocking a good percentage of the time.  So, an adaptive spin is still\nused against the blocking bit to avoid very high context switch rates.\n\nbtrfs_clear_lock_blocking() clears the blocking bit and returns\nwith the spinlock held again.\n\nbtrfs_tree_unlock() can be called on either blocking or spinning locks,\nit does the right thing based on the blocking bit.\n\nctree.c has a helper function to set/clear all the locked buffers in a\npath as blocking.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "b7a9f29fcf4e53e9ca7982331649fa2013e69c99",
      "tree": "544a1f9ca00af73fd22380610fd2d6961e066218",
      "parents": [
        "b51912c91fcf7581cc7b4550f1bb96422809d9ed"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Feb 04 09:23:45 2009 -0500"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Wed Feb 04 09:23:45 2009 -0500"
      },
      "message": "Btrfs: sort references by byte number during btrfs_inc_ref\n\nWhen a block goes through cow, we update the reference counts of\neverything that block points to.  The internal pointers of the block\ncan be in just about any order, and it is likely to have clusters of\nthings that are close together and clusters of things that are not.\n\nTo help reduce the seeks that come with updating all of these reference\ncounts, sort them by byte number before actual updates are done.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    }
  ],
  "next": "7237f1833601dcc435a64176c2c347ec4bd959f9"
}
