)]}'
{
  "commit": "ce36bd5ac8d54fa8cdedc6105926ab04cc76f40b",
  "tree": "381046d6d72eb412d0033788796bb6e1f8077dcb",
  "parents": [
    "30465659e001bc2c763f5731c7e2e125e47d286e"
  ],
  "author": {
    "name": "Vegard Nossum",
    "email": "vegard.nossum@oracle.com",
    "time": "Mon Nov 06 14:44:17 2023 +0100"
  },
  "committer": {
    "name": "Al Viro",
    "email": "viro@zeniv.linux.org.uk",
    "time": "Sat Nov 18 18:33:56 2023 -0500"
  },
  "message": "dcache: remove unnecessary NULL check in dget_dlock()\n\ndget_dlock() requires dentry-\u003ed_lock to be held when called, yet\ncontains a NULL check for dentry.\n\nAn audit of all calls to dget_dlock() shows that it is never called\nwith a NULL pointer (as spin_lock()/spin_unlock() would crash in these\ncases):\n\n  $ git grep -W \u0027\\\u003cdget_dlock\\\u003e\u0027\n\n  arch/powerpc/platforms/cell/spufs/inode.c-              spin_lock(\u0026dentry-\u003ed_lock);\n  arch/powerpc/platforms/cell/spufs/inode.c-              if (simple_positive(dentry)) {\n  arch/powerpc/platforms/cell/spufs/inode.c:                      dget_dlock(dentry);\n\n  fs/autofs/expire.c-             spin_lock_nested(\u0026child-\u003ed_lock, DENTRY_D_LOCK_NESTED);\n  fs/autofs/expire.c-             if (simple_positive(child)) {\n  fs/autofs/expire.c:                     dget_dlock(child);\n\n  fs/autofs/root.c:                       dget_dlock(active);\n  fs/autofs/root.c-                       spin_unlock(\u0026active-\u003ed_lock);\n\n  fs/autofs/root.c:                       dget_dlock(expiring);\n  fs/autofs/root.c-                       spin_unlock(\u0026expiring-\u003ed_lock);\n\n  fs/ceph/dir.c-          if (!spin_trylock(\u0026dentry-\u003ed_lock))\n  fs/ceph/dir.c-                  continue;\n  [...]\n  fs/ceph/dir.c:                          dget_dlock(dentry);\n\n  fs/ceph/mds_client.c-           spin_lock(\u0026alias-\u003ed_lock);\n  [...]\n  fs/ceph/mds_client.c:                   dn \u003d dget_dlock(alias);\n\n  fs/configfs/inode.c-            spin_lock(\u0026dentry-\u003ed_lock);\n  fs/configfs/inode.c-            if (simple_positive(dentry)) {\n  fs/configfs/inode.c:                    dget_dlock(dentry);\n\n  fs/libfs.c:                             found \u003d dget_dlock(d);\n  fs/libfs.c-                     spin_unlock(\u0026d-\u003ed_lock);\n\n  fs/libfs.c:             found \u003d dget_dlock(child);\n  fs/libfs.c-     spin_unlock(\u0026child-\u003ed_lock);\n\n  fs/libfs.c:                             child \u003d dget_dlock(d);\n  fs/libfs.c-                     spin_unlock(\u0026d-\u003ed_lock);\n\n  fs/ocfs2/dcache.c:                      dget_dlock(dentry);\n  fs/ocfs2/dcache.c-                      spin_unlock(\u0026dentry-\u003ed_lock);\n\n  include/linux/dcache.h:static inline struct dentry *dget_dlock(struct dentry *dentry)\n\nAfter taking out the NULL check, dget_dlock() becomes almost identical\nto __dget_dlock(); the only difference is that dget_dlock() returns the\ndentry that was passed in. These are static inline helpers, so we can\nrely on the compiler to discard unused return values. We can therefore\nalso remove __dget_dlock() and replace calls to it by dget_dlock().\n\nAlso fix up and improve the kerneldoc comments while we\u0027re at it.\n\nAl Viro pointed out that we can also clean up some of the callers to\nmake use of the returned value and provided a bit more info for the\nkerneldoc.\n\nWhile preparing v2 I also noticed that the tabs used in the kerneldoc\ncomments were causing the kerneldoc to get parsed incorrectly so I also\nfixed this up (including for d_unhashed, which is otherwise unrelated).\n\nTesting: x86 defconfig build + boot; make htmldocs for the kerneldoc\nwarning. objdump shows there are code generation changes.\n\nLink: https://lore.kernel.org/all/20231022164520.915013-1-vegard.nossum@oracle.com/\nCc: Alexander Viro \u003cviro@zeniv.linux.org.uk\u003e\nCc: Christian Brauner \u003cbrauner@kernel.org\u003e\nCc: linux-fsdevel@vger.kernel.org\nCc: Nick Piggin \u003cnpiggin@kernel.dk\u003e\nCc: Waiman Long \u003cWaiman.Long@hp.com\u003e\nCc: linux-doc@vger.kernel.org\nSigned-off-by: Vegard Nossum \u003cvegard.nossum@oracle.com\u003e\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a1c3ba6287be84fc308878a40470efefd653cccd",
      "old_mode": 33188,
      "old_path": "fs/dcache.c",
      "new_id": "78478cdf92595f01a55056fbbb208209848927c2",
      "new_mode": 33188,
      "new_path": "fs/dcache.c"
    },
    {
      "type": "modify",
      "old_id": "48b393545ec20f02b9cba9147228e24900987b59",
      "old_mode": 33188,
      "old_path": "include/linux/dcache.h",
      "new_id": "1666c387861f7a8fae32d7ae3acd17c950142ff5",
      "new_mode": 33188,
      "new_path": "include/linux/dcache.h"
    }
  ]
}
