fs/rename: Do not send notify if the same

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3
2024-09-15 10:11:42 +08:00
committed by Xiang Xiao
parent ddc3119c4e
commit 1bb0f19fd5
+9 -9
View File
@@ -249,8 +249,6 @@ next_subdir:
errout_with_lock:
inode_unlock();
errout:
RELEASE_SEARCH(&newdesc);
#ifdef CONFIG_FS_NOTIFY
if (ret >= 0)
{
@@ -258,6 +256,8 @@ errout:
}
#endif
errout:
RELEASE_SEARCH(&newdesc);
if (subdir != NULL)
{
lib_free(subdir);
@@ -462,6 +462,13 @@ next_subdir:
ret = oldinode->u.i_mops->rename(oldinode, oldrelpath, newrelpath);
#ifdef CONFIG_FS_NOTIFY
if (ret >= 0)
{
notify_rename(oldpath, oldisdir, newpath, newisdir);
}
#endif
errout_with_newinode:
inode_release(newinode);
@@ -472,13 +479,6 @@ errout_with_newsearch:
lib_free(subdir);
}
#ifdef CONFIG_FS_NOTIFY
if (ret >= 0)
{
notify_rename(oldpath, oldisdir, newpath, newisdir);
}
#endif
return ret;
}
#endif /* CONFIG_DISABLE_MOUNTPOINT */