lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 04/12] VFS: move dput() and mnt_drop_write() into done_path_update()
From
Date
All calls to done_path_update() are followed by the same two calls, so
merge them in.

Signed-off-by: NeilBrown <neilb@suse.de>
---
fs/namei.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 83ce2f7083be..f13bff877e30 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1732,6 +1732,8 @@ static void done_path_update(struct path *path, struct dentry *dentry,
} else {
inode_unlock(dir);
}
+ dput(dentry);
+ mnt_drop_write(path->mnt);
}

static struct dentry *lookup_fast(struct nameidata *nd,
@@ -3953,8 +3955,6 @@ void done_path_create_wq(struct path *path, struct dentry *dentry,
wait_queue_head_t *wq)
{
done_path_update(path, dentry, wq);
- dput(dentry);
- mnt_drop_write(path->mnt);
path_put(path);
}
EXPORT_SYMBOL(done_path_create_wq);
@@ -4276,8 +4276,6 @@ int do_rmdir(int dfd, struct filename *name)
error = vfs_rmdir(mnt_userns, path.dentry->d_inode, dentry);
exit3:
done_path_update(&path, dentry, &wq);
- dput(dentry);
- mnt_drop_write(path.mnt);
exit2:
path_put(&path);
if (retry_estale(error, lookup_flags)) {
@@ -4412,8 +4410,6 @@ int do_unlinkat(int dfd, struct filename *name)
&delegated_inode);
exit3:
done_path_update(&path, dentry, &wq);
- dput(dentry);
- mnt_drop_write(path.mnt);
}
if (inode)
iput(inode); /* truncate the inode here */

\
 
 \ /
  Last update: 2022-06-14 01:22    [W:0.263 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site