Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee6b1baf authored by Sage Weil's avatar Sage Weil
Browse files

ceph: avoid useless dget/dput in encode_fh



Nothing we do here sleeps, so just do it under d_lock and avoid the dget/
dput entirely.

Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent b8cd952b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -56,9 +56,7 @@ static int ceph_encode_fh(struct dentry *dentry, u32 *rawfh, int *max_len,
		return -EINVAL;

	spin_lock(&dentry->d_lock);
	parent = dget(dentry->d_parent);
	spin_unlock(&dentry->d_lock);

	parent = dentry->d_parent;
	if (*max_len >= connected_handle_length) {
		dout("encode_fh %p connectable\n", dentry);
		cfh->ino = ceph_ino(dentry->d_inode);
@@ -81,7 +79,7 @@ static int ceph_encode_fh(struct dentry *dentry, u32 *rawfh, int *max_len,
		*max_len = handle_length;
		type = 255;
	}
	dput(parent);
	spin_unlock(&dentry->d_lock);
	return type;
}