Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nlm: minor nlm_lookup_file argument change

It'll come in handy to get the whole nlm_lock.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

J. Bruce Fields and committed by
Chuck Lever
2dc6f19e 7de875b2

+12 -10
+2 -1
fs/lockd/svc4proc.c
··· 40 40 41 41 /* Obtain file pointer. Not used by FREE_ALL call. */ 42 42 if (filp != NULL) { 43 - if ((error = nlm_lookup_file(rqstp, &file, &lock->fh)) != 0) 43 + error = nlm_lookup_file(rqstp, &file, lock); 44 + if (error) 44 45 goto no_locks; 45 46 *filp = file; 46 47
+1 -1
fs/lockd/svcproc.c
··· 69 69 70 70 /* Obtain file pointer. Not used by FREE_ALL call. */ 71 71 if (filp != NULL) { 72 - error = cast_status(nlm_lookup_file(rqstp, &file, &lock->fh)); 72 + error = cast_status(nlm_lookup_file(rqstp, &file, lock)); 73 73 if (error != 0) 74 74 goto no_locks; 75 75 *filp = file;
+8 -7
fs/lockd/svcsubs.c
··· 82 82 */ 83 83 __be32 84 84 nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, 85 - struct nfs_fh *f) 85 + struct nlm_lock *lock) 86 86 { 87 87 struct nlm_file *file; 88 88 unsigned int hash; 89 89 __be32 nfserr; 90 90 91 - nlm_debug_print_fh("nlm_lookup_file", f); 91 + nlm_debug_print_fh("nlm_lookup_file", &lock->fh); 92 92 93 - hash = file_hash(f); 93 + hash = file_hash(&lock->fh); 94 94 95 95 /* Lock file table */ 96 96 mutex_lock(&nlm_file_mutex); 97 97 98 98 hlist_for_each_entry(file, &nlm_files[hash], f_list) 99 - if (!nfs_compare_fh(&file->f_handle, f)) 99 + if (!nfs_compare_fh(&file->f_handle, &lock->fh)) 100 100 goto found; 101 101 102 - nlm_debug_print_fh("creating file for", f); 102 + nlm_debug_print_fh("creating file for", &lock->fh); 103 103 104 104 nfserr = nlm_lck_denied_nolocks; 105 105 file = kzalloc(sizeof(*file), GFP_KERNEL); 106 106 if (!file) 107 107 goto out_unlock; 108 108 109 - memcpy(&file->f_handle, f, sizeof(struct nfs_fh)); 109 + memcpy(&file->f_handle, &lock->fh, sizeof(struct nfs_fh)); 110 110 mutex_init(&file->f_mutex); 111 111 INIT_HLIST_NODE(&file->f_list); 112 112 INIT_LIST_HEAD(&file->f_blocks); ··· 117 117 * We have to make sure we have the right credential to open 118 118 * the file. 119 119 */ 120 - if ((nfserr = nlmsvc_ops->fopen(rqstp, f, &file->f_file)) != 0) { 120 + nfserr = nlmsvc_ops->fopen(rqstp, &lock->fh, &file->f_file); 121 + if (nfserr) { 121 122 dprintk("lockd: open failed (error %d)\n", nfserr); 122 123 goto out_free; 123 124 }
+1 -1
include/linux/lockd/lockd.h
··· 286 286 * File handling for the server personality 287 287 */ 288 288 __be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, 289 - struct nfs_fh *); 289 + struct nlm_lock *); 290 290 void nlm_release_file(struct nlm_file *); 291 291 void nlmsvc_release_lockowner(struct nlm_lock *); 292 292 void nlmsvc_mark_resources(struct net *);