mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
Switch alloc_nfs_open_context() to struct path
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
2096f759ab
commit
6eae7974d0
1 changed files with 4 additions and 4 deletions
|
@ -574,14 +574,14 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync)
|
||||||
nfs_revalidate_inode(server, inode);
|
nfs_revalidate_inode(server, inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, struct dentry *dentry, struct rpc_cred *cred)
|
static struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred)
|
||||||
{
|
{
|
||||||
struct nfs_open_context *ctx;
|
struct nfs_open_context *ctx;
|
||||||
|
|
||||||
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
|
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
|
||||||
if (ctx != NULL) {
|
if (ctx != NULL) {
|
||||||
ctx->path.dentry = dget(dentry);
|
ctx->path = *path;
|
||||||
ctx->path.mnt = mntget(mnt);
|
path_get(&ctx->path);
|
||||||
ctx->cred = get_rpccred(cred);
|
ctx->cred = get_rpccred(cred);
|
||||||
ctx->state = NULL;
|
ctx->state = NULL;
|
||||||
ctx->lockowner = current->files;
|
ctx->lockowner = current->files;
|
||||||
|
@ -686,7 +686,7 @@ int nfs_open(struct inode *inode, struct file *filp)
|
||||||
cred = rpc_lookup_cred();
|
cred = rpc_lookup_cred();
|
||||||
if (IS_ERR(cred))
|
if (IS_ERR(cred))
|
||||||
return PTR_ERR(cred);
|
return PTR_ERR(cred);
|
||||||
ctx = alloc_nfs_open_context(filp->f_path.mnt, filp->f_path.dentry, cred);
|
ctx = alloc_nfs_open_context(&filp->f_path, cred);
|
||||||
put_rpccred(cred);
|
put_rpccred(cred);
|
||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue