)]}'
{
  "commit": "37be41241f43109c55d92cdbf303399eea642f14",
  "tree": "6bc6b0367103d08bdd812cd5c0047f952c839829",
  "parents": [
    "fd27c7a1bfa9801544ca961cdb4ca0b4998580b8"
  ],
  "author": {
    "name": "NeilBrown",
    "email": "neilb@suse.de",
    "time": "Fri Dec 08 02:36:16 2006 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.osdl.org",
    "time": "Fri Dec 08 08:28:39 2006 -0800"
  },
  "message": "[PATCH] lockdep: simplify some aspects of bd_mutex nesting\n\nWhen we open (actually blkdev_get) a partition we need to also open (get) the\nwhole device that holds the partition.  The involves some limited recursion.\nThis patch tries to simplify some aspects of this.\n\nAs well as opening the whole device, we need to increment -\u003ebd_part_count when\na partition is opened (this is used by rescan_partitions to avoid a rescan if\nany partition is active, as that would be confusing).\n\nThe main change this patch makes is to move the inc/dec of bd_part_count into\nblkdev_{get,put} for the whole rather than doing it in blkdev_{get,put} for\nthe partition.\n\nMore specifically, we introduce __blkdev_get and __blkdev_put which do exactly\nwhat blkdev_{get,put} did, only with an extra \"for_part\" argument\n(blkget_{get,put} then call the __ version with a \u00270\u0027 for the extra argument).\n\nIf for_part is 1, then the blkdev is being get(put) because a partition is\nbeing opened(closed) for the first(last) time, and so bd_part_count should be\nupdated (on success).  The particular advantage of pushing this function down\nis that the bd_mutex lock (which is needed to update bd_part_count) is already\nheld at the lower level.\n\nNote that this slightly changes the semantics of bd_part_count.  Instead of\nupdating it whenever a partition is opened or released, it is now only updated\non the first open or last release.  This is an adequate semantic as it is only\never tested for \"\u003d\u003d 0\".\n\nHaving introduced these functions we remove the current bd_part_count updates\nfrom do_open (which is really the body of blkdev_get) and call\n__blkdev_get(...  1).  Similarly in blkget_put we remove the old bd_part_count\nupdates and call __blkget_put(..., 1).  This call is moved to the end of\n__blkdev_put to avoid nested locks of bd_mutex.\n\nFinally the mutex_lock on whole-\u003ebd_mutex in do_open can be removed.  It was\nonly really needed to protect bd_part_count, and that is now managed (and\nprotected) within the recursive call.\n\nThe observation that bd_part_count is central to the locking issues, and the\nmodifications to create __blkdev_put are from Peter Zijlstra.\n\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nAcked-by: Peter Zijlstra \u003ca.p.zijlstra@chello.nl\u003e\nSigned-off-by: Neil Brown \u003cneilb@suse.de\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "36c38f48a4edaf9ff80c0cd434886649d80b3101",
      "old_mode": 33188,
      "old_path": "fs/block_dev.c",
      "new_id": "19f5f153ddb8d38051b758dd1b411da80f9691f6",
      "new_mode": 33188,
      "new_path": "fs/block_dev.c"
    }
  ]
}
