Lines Matching defs:ctx

100 			    struct nfs_open_context *ctx, struct nfs4_label *ilabel);
1285 static fmode_t _nfs4_ctx_to_accessmode(const struct nfs_open_context *ctx)
1287 return ctx->mode & (FMODE_READ|FMODE_WRITE|FMODE_EXEC);
1290 static fmode_t _nfs4_ctx_to_openmode(const struct nfs_open_context *ctx)
1292 fmode_t ret = ctx->mode & (FMODE_READ|FMODE_WRITE);
1294 return (ctx->mode & FMODE_EXEC) ? FMODE_READ | ret : ret;
2090 struct nfs_open_context *ctx;
2093 list_for_each_entry_rcu(ctx, &nfsi->open_files, list) {
2094 if (ctx->state != state)
2096 if ((ctx->mode & mode) != mode)
2098 if (!get_nfs_open_context(ctx))
2101 return ctx;
2110 struct nfs_open_context *ctx;
2112 ctx = nfs4_state_find_open_context_mode(state, FMODE_READ|FMODE_WRITE);
2113 if (!IS_ERR(ctx))
2114 return ctx;
2115 ctx = nfs4_state_find_open_context_mode(state, FMODE_WRITE);
2116 if (!IS_ERR(ctx))
2117 return ctx;
2121 static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context *ctx,
2126 opendata = nfs4_opendata_alloc(ctx->dentry, state->owner, 0, 0,
2196 static int _nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state *state)
2203 opendata = nfs4_open_recoverdata_alloc(ctx, state,
2218 static int nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state *state)
2224 err = _nfs4_do_open_reclaim(ctx, state);
2225 trace_nfs4_open_reclaim(ctx, 0, err);
2237 struct nfs_open_context *ctx;
2240 ctx = nfs4_state_find_open_context(state);
2241 if (IS_ERR(ctx))
2245 ret = nfs4_do_open_reclaim(ctx, state);
2246 put_nfs_open_context(ctx);
2305 int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
2312 opendata = nfs4_open_recoverdata_alloc(ctx, state,
2554 struct nfs_open_context *ctx)
2585 if (!ctx) {
2591 pnfs_lgopen_prepare(data, ctx);
2669 struct nfs_open_context *ctx)
2677 status = nfs4_run_open_task(data, ctx);
2723 static int _nfs4_open_expired(struct nfs_open_context *ctx, struct nfs4_state *state)
2728 opendata = nfs4_open_recoverdata_alloc(ctx, state, NFS4_OPEN_CLAIM_FH);
2739 d_drop(ctx->dentry);
2744 static int nfs4_do_open_expired(struct nfs_open_context *ctx, struct nfs4_state *state)
2751 err = _nfs4_open_expired(ctx, state);
2752 trace_nfs4_open_expired(ctx, 0, err);
2770 struct nfs_open_context *ctx;
2773 ctx = nfs4_state_find_open_context(state);
2774 if (IS_ERR(ctx))
2776 ret = nfs4_do_open_expired(ctx, state);
2777 put_nfs_open_context(ctx);
3038 struct nfs_open_context *ctx)
3044 fmode_t acc_mode = _nfs4_ctx_to_accessmode(ctx);
3053 ret = _nfs4_proc_open(opendata, ctx);
3061 ctx->state = state;
3078 dput(ctx->dentry);
3079 ctx->dentry = dentry = alias;
3097 pnfs_parse_lgopen(state->inode, opendata->lgp, ctx);
3104 nfs_inode_attach_open_context(ctx);
3124 struct nfs_open_context *ctx,
3133 struct dentry *dentry = ctx->dentry;
3134 const struct cred *cred = ctx->cred;
3135 struct nfs4_threshold **ctx_th = &ctx->mdsthreshold;
3136 fmode_t fmode = _nfs4_ctx_to_openmode(ctx);
3173 status = _nfs4_open_and_get_state(opendata, ctx);
3176 state = ctx->state;
3192 ctx, label);
3222 struct nfs_open_context *ctx,
3244 status = _nfs4_do_open(dir, ctx, flags, &c, opened);
3245 res = ctx->state;
3246 trace_nfs4_open_file(ctx, flags, status);
3299 struct nfs_open_context *ctx)
3324 } else if (ctx != NULL && ctx->state) {
3326 if (!nfs4_valid_open_stateid(ctx->state))
3328 l_ctx = nfs_get_lock_context(ctx);
3331 status = nfs4_select_rw_stateid(ctx->state, FMODE_WRITE, l_ctx,
3348 if (status == 0 && ctx != NULL)
3356 struct nfs_open_context *ctx, struct nfs4_label *ilabel)
3360 struct nfs4_state *state = ctx ? ctx->state : NULL;
3389 err = _nfs4_do_setattr(inode, &arg, &res, cred, ctx);
3805 nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx,
3811 label = nfs4_label_init_security(dir, ctx->dentry, attr, &l);
3814 state = nfs4_do_open(dir, ctx, open_flags, attr, label, opened);
3823 static void nfs4_close_context(struct nfs_open_context *ctx, int is_sync)
3825 if (ctx->state == NULL)
3828 nfs4_close_sync(ctx->state, _nfs4_ctx_to_openmode(ctx));
3830 nfs4_close_state(ctx->state, _nfs4_ctx_to_openmode(ctx));
4368 struct nfs_open_context *ctx = NULL;
4389 ctx = nfs_file_open_context(sattr->ia_file);
4390 if (ctx)
4391 cred = ctx->cred;
4398 status = nfs4_do_setattr(inode, cred, fattr, sattr, ctx, NULL);
4698 struct nfs_open_context *ctx;
4702 ctx = alloc_nfs_open_context(dentry, FMODE_READ, NULL);
4703 if (IS_ERR(ctx))
4704 return PTR_ERR(ctx);
4710 state = nfs4_do_open(dir, ctx, flags, sattr, ilabel, NULL);
4717 put_nfs_open_context(ctx);
5357 const struct nfs_open_context *ctx,
5361 return nfs4_select_rw_stateid(ctx->state, fmode, l_ctx, stateid, NULL);
5366 const struct nfs_open_context *ctx,
5373 if (nfs4_set_rw_stateid(&_current_stateid, ctx, l_ctx, fmode) == -EIO)
6844 struct nfs_open_context *ctx;
6852 struct nfs_open_context *ctx,
6869 p->ctx = get_nfs_open_context(ctx);
6870 p->l_ctx = nfs_get_lock_context(ctx);
6886 put_nfs_open_context(calldata->ctx);
6969 struct nfs_open_context *ctx,
6976 .rpc_cred = ctx->cred,
6997 set_bit(NFS_CONTEXT_UNLOCK, &ctx->flags);
6999 data = nfs4_alloc_unlockdata(fl, ctx, lsp, seqid);
7066 struct nfs_open_context *ctx;
7075 struct nfs_open_context *ctx, struct nfs4_lock_state *lsp,
7102 p->ctx = get_nfs_open_context(ctx);
7165 renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
7214 task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp,
7222 put_nfs_open_context(data->ctx);
7522 struct nfs_open_context *ctx;
7527 ctx = nfs_file_open_context(filp);
7528 state = ctx->state;
9680 exception->state = lgp->args.ctx->state;
9773 trace_nfs4_layoutget(lgp->args.ctx,