Lines Matching defs:inode

100 static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label, struct inode *inode);
101 static int nfs4_do_setattr(struct inode *inode, const struct cred *cred,
116 const __u32 *src, struct inode *inode,
122 nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
160 nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
295 struct inode *inode)
300 if (!inode || !nfs4_have_delegation(inode, FMODE_READ))
303 cache_validity = READ_ONCE(NFS_I(inode)->cache_validity);
316 const __u32 *src, struct inode *inode)
318 nfs4_bitmap_copy_adjust(dst, src, inode);
480 struct inode *inode = exception->inode;
496 if (inode != NULL && S_ISREG(inode->i_mode))
497 pnfs_destroy_layout(NFS_I(inode));
504 if (inode != NULL && stateid != NULL) {
505 nfs_inode_find_state_and_recover(inode,
511 if (inode) {
514 err = nfs_async_inode_return_delegation(inode,
1191 nfs4_inc_nlink_locked(struct inode *inode)
1193 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_OTHER;
1194 inc_nlink(inode);
1198 nfs4_dec_nlink_locked(struct inode *inode)
1200 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_OTHER;
1201 drop_nlink(inode);
1205 nfs4_update_changeattr_locked(struct inode *inode,
1209 struct nfs_inode *nfsi = NFS_I(inode);
1215 if (cinfo->atomic && cinfo->before == inode_peek_iversion_raw(inode)) {
1219 if (S_ISDIR(inode->i_mode)) {
1221 nfs_force_lookup_revalidate(inode);
1223 if (!NFS_PROTO(inode)->have_delegation(inode,
1228 if (cinfo->before != inode_peek_iversion_raw(inode))
1233 inode_set_iversion_raw(inode, cinfo->after);
1239 nfs_fscache_invalidate(inode);
1243 nfs4_update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo,
1343 struct inode *dir = d_inode(parent);
1660 trace_nfs4_open_stateid_update(state->inode, stateid, 0);
1695 if (!nfs4_has_session(NFS_SERVER(state->inode)->nfs_client))
1708 trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0);
1732 trace_nfs4_open_stateid_update(state->inode, stateid, status);
1796 struct nfs_server *server = NFS_SERVER(state->inode);
1798 struct nfs_inode *nfsi = NFS_I(state->inode);
1812 deleg_cur = nfs4_get_valid_delegation(state->inode);
1865 static void nfs4_return_incompatible_delegation(struct inode *inode, fmode_t fmode)
1871 delegation = nfs4_get_valid_delegation(inode);
1877 nfs4_inode_return_delegation(inode);
1899 delegation = nfs4_get_valid_delegation(state->inode);
1909 ret = nfs_may_open(state->inode, state->owner->so_cred, open_mode);
1929 struct nfs_client *clp = NFS_SERVER(state->inode)->nfs_client;
1934 delegation = rcu_dereference(NFS_I(state->inode)->delegation);
1950 nfs_inode_set_delegation(state->inode,
1956 nfs_inode_reclaim_delegation(state->inode,
1963 nfs_async_inode_return_delegation(state->inode,
1968 * Check the inode attributes against the CLAIM_PREVIOUS returned attributes
1974 struct inode *inode = data->state->inode;
1984 ret = nfs_refresh_inode(inode, &data->f_attr);
1999 static struct inode *
2002 struct inode *inode;
2010 inode = nfs_fhget(data->dir->d_sb, &data->o_res.fh,
2014 inode = d_inode(data->dentry);
2015 ihold(inode);
2016 nfs_refresh_inode(inode, &data->f_attr);
2018 return inode;
2025 struct inode *inode;
2027 inode = nfs4_opendata_get_inode(data);
2028 if (IS_ERR(inode))
2029 return ERR_CAST(inode);
2030 if (data->state != NULL && data->state->inode == inode) {
2034 state = nfs4_get_open_state(inode, data->owner);
2035 iput(inode);
2084 struct nfs_inode *nfsi = NFS_I(state->inode);
2203 delegation = rcu_dereference(NFS_I(state->inode)->delegation);
2215 struct nfs_server *server = NFS_SERVER(state->inode);
2279 nfs_inode_find_state_and_recover(state->inode,
2302 struct nfs_server *server = NFS_SERVER(state->inode);
2441 delegation = nfs4_get_valid_delegation(data->state->inode);
2546 struct inode *dir = d_inode(data->dir);
2596 struct inode *dir = d_inode(data->dir);
2640 if (S_ISDIR(state->inode->i_mode))
2649 nfs_access_add_cache(state->inode, &cache);
2664 struct inode *dir = d_inode(data->dir);
2736 struct nfs_server *server = NFS_SERVER(state->inode);
2774 nfs_remove_bad_delegation(state->inode, stateid);
2780 if (rcu_access_pointer(NFS_I(state->inode)->delegation) != NULL)
2833 struct nfs_server *server = NFS_SERVER(state->inode);
2841 delegation = rcu_dereference(NFS_I(state->inode)->delegation);
2878 nfs4_copy_delegation_stateid(state->inode, state->state,
2889 * @state: NFSv4 state for an inode
2898 struct nfs_server *server = NFS_SERVER(state->inode);
2941 * @state: NFSv4 state for an inode
2948 struct nfs_server *server = NFS_SERVER(state->inode);
3035 struct inode *dir = d_inode(opendata->dir);
3061 alias = d_exact_alias(dentry, state->inode);
3063 alias = d_splice_alias(igrab(state->inode), dentry);
3085 pnfs_parse_lgopen(state->inode, opendata->lgp, ctx);
3092 if (d_inode(dentry) == state->inode) {
3112 static int _nfs4_do_open(struct inode *dir,
3188 status = nfs4_do_setattr(state->inode, cred,
3192 nfs_setattr_update_inode(state->inode, sattr,
3194 nfs_setsecurity(state->inode, opendata->o_res.f_attr, olabel);
3223 static struct nfs4_state *nfs4_do_open(struct inode *dir,
3297 static int _nfs4_do_setattr(struct inode *inode,
3303 struct nfs_server *server = NFS_SERVER(inode);
3320 nfs4_inode_make_writeable(inode);
3324 if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) {
3352 trace_nfs4_setattr(inode, &arg->stateid, status);
3356 static int nfs4_do_setattr(struct inode *inode, const struct cred *cred,
3361 struct nfs_server *server = NFS_SERVER(inode);
3365 .fh = NFS_FH(inode),
3378 .inode = inode,
3386 inode);
3388 err = _nfs4_do_setattr(inode, &arg, &res, cred, ctx);
3412 nfs4_wait_on_layoutreturn(struct inode *inode, struct rpc_task *task)
3414 if (inode == NULL || !nfs_have_layout(inode))
3417 return pnfs_wait_on_layoutreturn(inode, task);
3492 trace_nfs4_close_stateid_update_wait(state->inode, dst, 0);
3517 struct inode *inode;
3536 struct super_block *sb = calldata->state->inode->i_sb;
3552 struct nfs_server *server = NFS_SERVER(calldata->inode);
3556 .inode = calldata->inode,
3570 /* hmm. we are done with the inode, and in the process of freeing
3614 nfs_refresh_inode(calldata->inode, &calldata->fattr);
3627 struct inode *inode = calldata->inode;
3628 struct nfs_server *server = NFS_SERVER(inode);
3668 if (!calldata->lr.roc && nfs4_wait_on_layoutreturn(inode, task)) {
3684 if (!nfs4_have_delegation(inode, FMODE_READ)) {
3687 inode, server, NULL);
3694 nfs4_map_atomic_open_share(NFS_SERVER(inode),
3702 if (nfs4_setup_sequence(NFS_SERVER(inode)->nfs_client,
3725 * the inode is cleared. This in turn means that we are not good
3728 * stateid's in the inode.
3734 struct nfs_server *server = NFS_SERVER(state->inode);
3759 calldata->inode = state->inode;
3761 calldata->arg.fh = NFS_FH(state->inode);
3776 calldata->lr.roc = pnfs_roc(state->inode,
3782 nfs_sb_active(calldata->inode->i_sb);
3803 static struct inode *
3804 nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx,
3819 return state->inode;
4124 * we detect fsid mismatch in inode revalidation
4126 static int nfs4_get_referral(struct rpc_clnt *client, struct inode *dir,
4171 struct inode *inode)
4191 if (inode && (server->flags & NFS_MOUNT_SOFTREVAL))
4194 nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, label), inode);
4204 struct inode *inode)
4211 err = _nfs4_proc_getattr(server, fhandle, fattr, label, inode);
4224 * Close is called when the inode is destroyed.
4240 struct inode *inode = d_inode(dentry);
4246 if (pnfs_ld_layoutret_on_setattr(inode) &&
4248 sattr->ia_size < i_size_read(inode))
4249 pnfs_commit_and_return_layout(inode);
4269 label = nfs4_label_alloc(NFS_SERVER(inode), GFP_KERNEL);
4275 nfs4_inode_make_writeable(inode);
4277 status = nfs4_do_setattr(inode, cred, fattr, sattr, ctx, NULL, label);
4279 nfs_setattr_update_inode(inode, sattr, fattr);
4280 nfs_setsecurity(inode, fattr, label);
4286 static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir,
4334 static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
4380 static int nfs4_proc_lookup(struct inode *dir, struct dentry *dentry,
4396 nfs4_proc_lookup_mountpoint(struct inode *dir, struct dentry *dentry,
4408 static int _nfs4_proc_lookupp(struct inode *inode,
4412 struct rpc_clnt *clnt = NFS_CLIENT(inode);
4413 struct nfs_server *server = NFS_SERVER(inode);
4417 .fh = NFS_FH(inode),
4435 dprintk("NFS call lookupp ino=0x%lx\n", inode->i_ino);
4442 static int nfs4_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
4450 err = _nfs4_proc_lookupp(inode, fhandle, fattr, label);
4451 trace_nfs4_lookupp(inode, err);
4452 err = nfs4_handle_exception(NFS_SERVER(inode), err,
4458 static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
4460 struct nfs_server *server = NFS_SERVER(inode);
4462 .fh = NFS_FH(inode),
4476 if (!nfs4_have_delegation(inode, FMODE_READ)) {
4486 nfs_refresh_inode(inode, res.fattr);
4492 static int nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
4499 err = _nfs4_proc_access(inode, entry);
4500 trace_nfs4_access(inode, err);
4501 err = nfs4_handle_exception(NFS_SERVER(inode), err,
4529 static int _nfs4_proc_readlink(struct inode *inode, struct page *page,
4533 .fh = NFS_FH(inode),
4545 return nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode), &msg, &args.seq_args, &res.seq_res, 0);
4548 static int nfs4_proc_readlink(struct inode *inode, struct page *page,
4556 err = _nfs4_proc_readlink(inode, page, pgbase, pglen);
4557 trace_nfs4_readlink(inode, err);
4558 err = nfs4_handle_exception(NFS_SERVER(inode), err,
4568 nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
4597 _nfs4_proc_remove(struct inode *dir, const struct qstr *name, u32 ftype)
4628 static int nfs4_proc_remove(struct inode *dir, struct dentry *dentry)
4633 struct inode *inode = d_inode(dentry);
4636 if (inode) {
4637 if (inode->i_nlink == 1)
4638 nfs4_inode_return_delegation(inode);
4640 nfs4_inode_make_writeable(inode);
4651 static int nfs4_proc_rmdir(struct inode *dir, const struct qstr *name)
4669 struct inode *inode)
4680 if (inode)
4681 nfs4_inode_return_delegation(inode);
4692 static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
4715 struct inode *old_inode = d_inode(old_dentry);
4716 struct inode *new_inode = d_inode(new_dentry);
4735 static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
4736 struct inode *new_dir)
4765 static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
4767 struct nfs_server *server = NFS_SERVER(inode);
4770 .fh = NFS_FH(inode),
4796 nfs4_inode_make_writeable(inode);
4797 nfs4_bitmap_copy_adjust_setattr(bitmask, nfs4_bitmask(server, res.label), inode);
4803 status = nfs_post_op_update_inode(inode, res.fattr);
4805 nfs_setsecurity(inode, res.fattr, res.label);
4816 static int nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
4823 err = nfs4_handle_exception(NFS_SERVER(inode),
4824 _nfs4_proc_link(inode, dir, name),
4839 static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
4874 static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_createdata *data)
4898 static int _nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
4925 static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
4947 static int _nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
4965 static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
4993 struct inode *dir = d_inode(dentry);
5051 static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
5086 static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
5280 struct nfs_server *server = NFS_SERVER(hdr->inode);
5285 .inode = hdr->inode,
5319 struct nfs_server *server = NFS_SERVER(hdr->inode);
5343 nfs_invalidate_atime(hdr->inode);
5369 nfs42_read_plus_support(NFS_SERVER(hdr->inode), msg);
5376 if (nfs4_setup_sequence(NFS_SERVER(hdr->inode)->nfs_client,
5393 struct inode *inode = hdr->inode;
5398 .inode = hdr->inode,
5403 NFS_SERVER(inode), task->tk_status,
5411 renew_lease(NFS_SERVER(inode), hdr->timestamp);
5450 return nfs4_have_delegation(hdr->inode, FMODE_READ) == 0;
5454 struct inode *inode, struct nfs_server *server,
5457 unsigned long cache_validity = READ_ONCE(NFS_I(inode)->cache_validity);
5479 if (nfs4_have_delegation(inode, FMODE_READ) &&
5494 struct nfs_server *server = NFS_SERVER(hdr->inode);
5502 hdr->inode, server, NULL);
5518 nfs4_setup_sequence(NFS_SERVER(data->inode)->nfs_client,
5526 struct inode *inode = data->inode;
5529 if (nfs4_async_handle_error(task, NFS_SERVER(inode),
5547 struct nfs_server *server = NFS_SERVER(data->inode);
5561 struct inode *dst_inode = file_inode(dst);
5730 static void nfs4_set_cached_acl(struct inode *inode, struct nfs4_cached_acl *acl)
5732 struct nfs_inode *nfsi = NFS_I(inode);
5734 spin_lock(&inode->i_lock);
5737 spin_unlock(&inode->i_lock);
5740 static void nfs4_zap_acl_attr(struct inode *inode)
5742 nfs4_set_cached_acl(inode, NULL);
5745 static inline ssize_t nfs4_read_cached_acl(struct inode *inode, char *buf, size_t buflen)
5747 struct nfs_inode *nfsi = NFS_I(inode);
5751 spin_lock(&inode->i_lock);
5766 spin_unlock(&inode->i_lock);
5770 static void nfs4_write_cached_acl(struct inode *inode, struct page **pages, size_t pgbase, size_t acl_len)
5789 nfs4_set_cached_acl(inode, acl);
5802 static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
5806 .fh = NFS_FH(inode),
5819 struct nfs_server *server = NFS_SERVER(inode);
5846 ret = nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode),
5859 nfs4_write_cached_acl(inode, pages, res.acl_data_offset, res.acl_len);
5878 static ssize_t nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
5885 ret = __nfs4_get_acl_uncached(inode, buf, buflen);
5886 trace_nfs4_get_acl(inode, ret);
5889 ret = nfs4_handle_exception(NFS_SERVER(inode), ret, &exception);
5894 static ssize_t nfs4_proc_get_acl(struct inode *inode, void *buf, size_t buflen)
5896 struct nfs_server *server = NFS_SERVER(inode);
5901 ret = nfs_revalidate_inode(server, inode);
5904 if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL)
5905 nfs_zap_acl_cache(inode);
5906 ret = nfs4_read_cached_acl(inode, buf, buflen);
5911 return nfs4_get_acl_uncached(inode, buf, buflen);
5914 static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen)
5916 struct nfs_server *server = NFS_SERVER(inode);
5919 .fh = NFS_FH(inode),
5942 nfs4_inode_make_writeable(inode);
5953 * Acl update can result in inode attribute update.
5956 spin_lock(&inode->i_lock);
5957 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_CHANGE
5960 spin_unlock(&inode->i_lock);
5961 nfs_access_zap_cache(inode);
5962 nfs_zap_acl_cache(inode);
5966 static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen)
5971 err = __nfs4_proc_set_acl(inode, buf, buflen);
5972 trace_nfs4_set_acl(inode, err);
5981 err = nfs4_handle_exception(NFS_SERVER(inode), err,
5988 static int _nfs4_get_security_label(struct inode *inode, void *buf,
5991 struct nfs_server *server = NFS_SERVER(inode);
5997 .fh = NFS_FH(inode),
6022 static int nfs4_get_security_label(struct inode *inode, void *buf,
6030 if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL))
6034 err = _nfs4_get_security_label(inode, buf, buflen);
6035 trace_nfs4_get_security_label(inode, err);
6036 err = nfs4_handle_exception(NFS_SERVER(inode), err,
6042 static int _nfs4_do_set_security_label(struct inode *inode,
6049 struct nfs_server *server = NFS_SERVER(inode);
6052 .fh = NFS_FH(inode),
6079 static int nfs4_do_set_security_label(struct inode *inode,
6088 err = _nfs4_do_set_security_label(inode, ilabel,
6090 trace_nfs4_set_security_label(inode, err);
6091 err = nfs4_handle_exception(NFS_SERVER(inode), err,
6098 nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen)
6104 if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL))
6114 olabel = nfs4_label_alloc(NFS_SERVER(inode), GFP_KERNEL);
6120 status = nfs4_do_set_security_label(inode, &ilabel, &fattr, olabel);
6122 nfs_setsecurity(inode, &fattr, olabel);
6413 struct inode *inode;
6420 .inode = data->inode,
6452 if (!nfs4_refresh_delegation_stateid(&data->stateid, data->inode))
6473 nfs_delegation_mark_returned(data->inode, data->args.stateid);
6484 struct inode *inode = data->inode;
6489 if (inode) {
6491 inode_peek_iversion_raw(inode));
6492 nfs_refresh_inode(inode, &data->fattr);
6493 nfs_iput_and_deactive(inode);
6505 if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task)) {
6528 static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, const nfs4_stateid *stateid, int issync)
6531 struct nfs_server *server = NFS_SERVER(inode);
6556 server->cache_consistency_bitmask, inode, server,
6559 nfs_copy_fh(&data->fh, NFS_FH(inode));
6568 data->inode = nfs_igrab_and_active(inode);
6569 if (data->inode || issync) {
6570 data->lr.roc = pnfs_roc(inode, &data->lr.arg, &data->lr.res,
6578 if (!data->inode)
6601 int nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, const nfs4_stateid *stateid, int issync)
6603 struct nfs_server *server = NFS_SERVER(inode);
6607 err = _nfs4_proc_delegreturn(inode, cred, stateid, issync);
6608 trace_nfs4_delegreturn(inode, stateid, err);
6622 struct inode *inode = state->inode;
6623 struct nfs_server *server = NFS_SERVER(inode);
6626 .fh = NFS_FH(inode),
6672 err = nfs4_handle_exception(NFS_SERVER(state->inode), err,
6732 struct inode *inode = state->inode;
6737 p->arg.fh = NFS_FH(inode);
6747 p->server = NFS_SERVER(inode);
6768 .inode = calldata->lsp->ls_state->inode,
6777 locks_lock_inode_wait(calldata->lsp->ls_state->inode, &calldata->fl);
6853 .rpc_client = NFS_CLIENT(lsp->ls_state->inode),
6860 nfs4_state_protect(NFS_SERVER(lsp->ls_state->inode)->nfs_client,
6885 struct inode *inode = state->inode;
6887 struct nfs_inode *nfsi = NFS_I(inode);
6902 if (locks_lock_inode_wait(inode, request) == -ENOENT) {
6915 alloc_seqid = NFS_SERVER(inode)->nfs_client->cl_mvops->alloc_seqid;
6949 struct inode *inode = lsp->ls_state->inode;
6950 struct nfs_server *server = NFS_SERVER(inode);
6957 p->arg.fh = NFS_FH(inode);
7042 if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
7135 .rpc_client = NFS_CLIENT(state->inode),
7180 struct nfs_server *server = NFS_SERVER(state->inode);
7182 .inode = state->inode,
7200 struct nfs_server *server = NFS_SERVER(state->inode);
7202 .inode = state->inode,
7249 struct nfs_inode *nfsi = NFS_I(state->inode);
7255 status = locks_lock_inode_wait(state->inode, request);
7264 status = locks_lock_inode_wait(state->inode, request);
7281 .inode = state->inode,
7290 err = nfs4_handle_exception(NFS_SERVER(state->inode),
7321 struct inode *inode;
7341 /* Make sure it's for the right inode */
7342 if (nfs_compare_fh(NFS_FH(waiter->inode), &cbnl->cbnl_fh))
7360 struct nfs_server *server = NFS_SERVER(state->inode);
7367 .inode = state->inode,
7460 struct nfs_server *server = NFS_SERVER(state->inode);
7558 struct dentry *unused, struct inode *inode,
7562 return nfs4_proc_set_acl(inode, buf, buflen);
7566 struct dentry *unused, struct inode *inode,
7569 return nfs4_proc_get_acl(inode, buf, buflen);
7580 struct dentry *unused, struct inode *inode,
7585 return nfs4_set_security_label(inode, buf, buflen);
7591 struct dentry *unused, struct inode *inode,
7595 return nfs4_get_security_label(inode, buf, buflen);
7600 nfs4_listxattr_nfs4_label(struct inode *inode, char *list, size_t list_len)
7604 if (nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL)) {
7605 len = security_inode_listsecurity(inode, list, list_len);
7621 nfs4_listxattr_nfs4_label(struct inode *inode, char *list, size_t list_len)
7630 struct dentry *unused, struct inode *inode,
7637 if (!nfs_server_capable(inode, NFS_CAP_XATTR))
7649 if (!nfs_access_get_cached(inode, current_cred(), &mask, true)) {
7655 ret = nfs42_proc_removexattr(inode, key);
7657 nfs4_xattr_cache_remove(inode, key);
7659 ret = nfs42_proc_setxattr(inode, key, buf, buflen, flags);
7661 nfs4_xattr_cache_add(inode, key, buf, NULL, buflen);
7668 struct dentry *unused, struct inode *inode,
7674 if (!nfs_server_capable(inode, NFS_CAP_XATTR))
7677 if (!nfs_access_get_cached(inode, current_cred(), &mask, true)) {
7682 ret = nfs_revalidate_inode(NFS_SERVER(inode), inode);
7686 ret = nfs4_xattr_cache_get(inode, key, buf, buflen);
7690 ret = nfs42_proc_getxattr(inode, key, buf, buflen);
7696 nfs4_listxattr_nfs4_user(struct inode *inode, char *list, size_t list_len)
7705 if (!nfs_server_capable(inode, NFS_CAP_XATTR))
7708 if (!nfs_access_get_cached(inode, current_cred(), &mask, true)) {
7713 ret = nfs_revalidate_inode(NFS_SERVER(inode), inode);
7717 ret = nfs4_xattr_cache_list(inode, list, list_len);
7728 ret = nfs42_proc_listxattrs(inode, buf, buflen,
7741 nfs4_xattr_cache_set_list(inode, list, size);
7749 nfs4_listxattr_nfs4_user(struct inode *inode, char *list, size_t list_len)
7772 static int _nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
7815 int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
7841 static int _nfs40_proc_get_locations(struct inode *inode,
7845 struct nfs_server *server = NFS_SERVER(inode);
7852 .fh = NFS_FH(inode),
7898 static int _nfs41_proc_get_locations(struct inode *inode,
7902 struct nfs_server *server = NFS_SERVER(inode);
7908 .fh = NFS_FH(inode),
7942 * @inode: inode on FSID that is migrating
7957 int nfs4_proc_get_locations(struct inode *inode,
7961 struct nfs_server *server = NFS_SERVER(inode);
7974 nfs_display_fhandle(NFS_FH(inode), __func__);
7977 status = ops->get_locations(inode, locations, page, cred);
7992 static int _nfs40_proc_fsid_present(struct inode *inode, const struct cred *cred)
7994 struct nfs_server *server = NFS_SERVER(inode);
7995 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
7998 .fh = NFS_FH(inode),
8038 static int _nfs41_proc_fsid_present(struct inode *inode, const struct cred *cred)
8040 struct nfs_server *server = NFS_SERVER(inode);
8043 .fh = NFS_FH(inode),
8073 * @inode: inode on FSID to check
8085 int nfs4_proc_fsid_present(struct inode *inode, const struct cred *cred)
8087 struct nfs_server *server = NFS_SERVER(inode);
8100 nfs_display_fhandle(NFS_FH(inode), __func__);
8103 status = ops->fsid_present(inode, cred);
8118 static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors, bool use_integrity)
8169 int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name,
9383 struct nfs_server *server = NFS_SERVER(lgp->args.inode);
9404 struct inode *inode = lgp->args.inode;
9405 struct nfs_server *server = NFS_SERVER(inode);
9458 spin_lock(&inode->i_lock);
9459 lo = NFS_I(inode)->layout;
9463 spin_unlock(&inode->i_lock);
9473 spin_unlock(&inode->i_lock);
9474 nfs_commit_inode(inode, 0);
9517 struct inode *inode = lgp->args.inode;
9518 struct nfs_server *server = NFS_SERVER(inode);
9535 .inode = inode,
9543 pnfs_get_layout_hdr(NFS_I(inode)->layout);
9608 server = NFS_SERVER(lrp->args.inode);
9613 lrp->args.inode))
9646 nfs_iput_and_deactive(lrp->inode);
9668 .rpc_client = NFS_SERVER(lrp->args.inode)->client,
9675 nfs4_state_protect(NFS_SERVER(lrp->args.inode)->nfs_client,
9680 lrp->inode = nfs_igrab_and_active(lrp->args.inode);
9682 if (!lrp->inode) {
9688 if (!lrp->inode)
9699 trace_nfs4_layoutreturn(lrp->args.inode, &lrp->args.stateid, status);
9757 struct nfs_server *server = NFS_SERVER(data->args.inode);
9769 struct nfs_server *server = NFS_SERVER(data->args.inode);
9795 nfs_post_op_update_inode_force_wcc(data->args.inode,
9798 nfs_iput_and_deactive(data->inode);
9819 .rpc_client = NFS_CLIENT(data->args.inode),
9828 "lbw: %llu inode %lu\n", sync,
9830 data->args.inode->i_ino);
9833 data->inode = nfs_igrab_and_active(data->args.inode);
9834 if (data->inode == NULL) {
9846 trace_nfs4_layoutcommit(data->args.inode, &data->args.stateid, status);
10402 static void nfs4_enable_swap(struct inode *inode)
10407 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
10412 static void nfs4_disable_swap(struct inode *inode)
10417 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;