Beispiel #1
0
int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd)
{
	int ret;
	struct dentry *dir;

	dir = rpc_d_lookup_sb(sb, "cache");
	ret = sunrpc_cache_register_pipefs(dir, cd->name, 0600, cd);
	dput(dir);
	return ret;
}
Beispiel #2
0
int nfs_cache_register(struct cache_detail *cd)
{
	struct nameidata nd;
	struct vfsmount *mnt;
	int ret;

	mnt = rpc_get_mount();
	if (IS_ERR(mnt))
		return PTR_ERR(mnt);
	ret = vfs_path_lookup(mnt->mnt_root, mnt, "/cache", 0, &nd);
	if (ret)
		goto err;
	ret = sunrpc_cache_register_pipefs(nd.path.dentry,
			cd->name, 0600, cd);
	path_put(&nd.path);
	if (!ret)
		return ret;
err:
	rpc_put_mount();
	return ret;
}