nfs3proc.c (2ac5e38ea4203852d6e99edd3cf11f044b0a409f) | nfs3proc.c (b68572e07c58324cb8c274f1d84a20cad479c2d3) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * linux/fs/nfs/nfs3proc.c 4 * 5 * Client-side NFSv3 procedures stubs. 6 * 7 * Copyright (C) 1997, Olaf Kirch 8 */ --- 181 unchanged lines hidden (view full) --- 190 191static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) 192{ 193 struct nfs3_accessargs arg = { 194 .fh = NFS_FH(inode), 195 .access = entry->mask, 196 }; 197 struct nfs3_accessres res; | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * linux/fs/nfs/nfs3proc.c 4 * 5 * Client-side NFSv3 procedures stubs. 6 * 7 * Copyright (C) 1997, Olaf Kirch 8 */ --- 181 unchanged lines hidden (view full) --- 190 191static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) 192{ 193 struct nfs3_accessargs arg = { 194 .fh = NFS_FH(inode), 195 .access = entry->mask, 196 }; 197 struct nfs3_accessres res; |
198 struct auth_cred acred = { 199 .cred = entry->cred, 200 }; |
|
198 struct rpc_message msg = { 199 .rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS], 200 .rpc_argp = &arg, 201 .rpc_resp = &res, | 201 struct rpc_message msg = { 202 .rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS], 203 .rpc_argp = &arg, 204 .rpc_resp = &res, |
202 .rpc_cred = entry->cred, | 205 .rpc_cred = rpc_lookup_generic_cred(&acred, 0, GFP_NOFS), |
203 }; 204 int status = -ENOMEM; 205 206 dprintk("NFS call access\n"); | 206 }; 207 int status = -ENOMEM; 208 209 dprintk("NFS call access\n"); |
210 if (!msg.rpc_cred) 211 goto out; |
|
207 res.fattr = nfs_alloc_fattr(); 208 if (res.fattr == NULL) 209 goto out; 210 211 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 212 nfs_refresh_inode(inode, res.fattr); 213 if (status == 0) 214 nfs_access_set_mask(entry, res.access); 215 nfs_free_fattr(res.fattr); 216out: | 212 res.fattr = nfs_alloc_fattr(); 213 if (res.fattr == NULL) 214 goto out; 215 216 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 217 nfs_refresh_inode(inode, res.fattr); 218 if (status == 0) 219 nfs_access_set_mask(entry, res.access); 220 nfs_free_fattr(res.fattr); 221out: |
222 if (msg.rpc_cred) 223 put_rpccred(msg.rpc_cred); |
|
217 dprintk("NFS reply access: %d\n", status); 218 return status; 219} 220 221static int nfs3_proc_readlink(struct inode *inode, struct page *page, 222 unsigned int pgbase, unsigned int pglen) 223{ 224 struct nfs_fattr *fattr; --- 783 unchanged lines hidden --- | 224 dprintk("NFS reply access: %d\n", status); 225 return status; 226} 227 228static int nfs3_proc_readlink(struct inode *inode, struct page *page, 229 unsigned int pgbase, unsigned int pglen) 230{ 231 struct nfs_fattr *fattr; --- 783 unchanged lines hidden --- |