cregit-Linux how code gets into the kernel

Release 4.10 fs/nfsd/lockd.c

Directory: fs/nfsd
/*
 * This file contains all the stubs needed when communicating with lockd.
 * This level of indirection is necessary so we can run nfsd+lockd without
 * requiring the nfs client to be compiled in/loaded, and vice versa.
 *
 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
 */

#include <linux/file.h>
#include <linux/lockd/bind.h>
#include "nfsd.h"
#include "vfs.h"


#define NFSDDBG_FACILITY		NFSDDBG_LOCKD

#ifdef CONFIG_LOCKD_V4

#define nlm_stale_fh	nlm4_stale_fh

#define nlm_failed	nlm4_failed
#else

#define nlm_stale_fh	nlm_lck_denied_nolocks

#define nlm_failed	nlm_lck_denied_nolocks
#endif
/*
 * Note: we hold the dentry use count while the file is open.
 */

static __be32 nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp) { __be32 nfserr; struct svc_fh fh; /* must initialize before using! but maxsize doesn't matter */ fh_init(&fh,0); fh.fh_handle.fh_size = f->size; memcpy((char*)&fh.fh_handle.fh_base, f->data, f->size); fh.fh_export = NULL; nfserr = nfsd_open(rqstp, &fh, S_IFREG, NFSD_MAY_LOCK, filp); fh_put(&fh); /* We return nlm error codes as nlm doesn't know * about nfsd, but nfsd does know about nlm.. */ switch (nfserr) { case nfs_ok: return 0; case nfserr_dropit: return nlm_drop_reply; case nfserr_stale: return nlm_stale_fh; default: return nlm_failed; } }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git11489.76%753.85%
neil brownneil brown86.30%215.38%
miklos szeredimiklos szeredi32.36%215.38%
al viroal viro21.57%215.38%
Total127100.00%13100.00%


static void nlm_fclose(struct file *filp) { fput(filp); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git1593.75%150.00%
neil brownneil brown16.25%150.00%
Total16100.00%2100.00%

static const struct nlmsvc_binding nfsd_nlm_ops = { .fopen = nlm_fopen, /* open file for locking */ .fclose = nlm_fclose, /* close file */ };
void nfsd_lockd_init(void) { dprintk("nfsd: initializing lockd\n"); nlmsvc_ops = &nfsd_nlm_ops; }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git17100.00%1100.00%
Total17100.00%1100.00%


void nfsd_lockd_shutdown(void) { nlmsvc_ops = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git11100.00%1100.00%
Total11100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git18077.25%836.36%
miklos szeredimiklos szeredi2611.16%29.09%
neil brownneil brown156.44%418.18%
j. bruce fieldsj. bruce fields52.15%313.64%
al viroal viro20.86%29.09%
boaz harroshboaz harrosh20.86%14.55%
dave jonesdave jones20.86%14.55%
julia lawalljulia lawall10.43%14.55%
Total233100.00%22100.00%
Directory: fs/nfsd
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.