|
@@ -796,7 +796,9 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(nfs_close_context);
|
|
|
|
|
|
-struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode)
|
|
|
+struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry,
|
|
|
+ fmode_t f_mode,
|
|
|
+ struct file *filp)
|
|
|
{
|
|
|
struct nfs_open_context *ctx;
|
|
|
struct rpc_cred *cred = rpc_lookup_cred();
|
|
@@ -815,6 +817,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f
|
|
|
ctx->mode = f_mode;
|
|
|
ctx->flags = 0;
|
|
|
ctx->error = 0;
|
|
|
+ ctx->flock_owner = (fl_owner_t)filp;
|
|
|
nfs_init_lock_context(&ctx->lock_context);
|
|
|
ctx->lock_context.open_context = ctx;
|
|
|
INIT_LIST_HEAD(&ctx->list);
|
|
@@ -939,7 +942,7 @@ int nfs_open(struct inode *inode, struct file *filp)
|
|
|
{
|
|
|
struct nfs_open_context *ctx;
|
|
|
|
|
|
- ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode);
|
|
|
+ ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode, filp);
|
|
|
if (IS_ERR(ctx))
|
|
|
return PTR_ERR(ctx);
|
|
|
nfs_file_set_open_context(filp, ctx);
|