return res;
}
-static void nlm4_compute_offsets(const struct nlm_lock *lock,
+static void nlm4_compute_offsets(const struct lockd_lock *lock,
u64 *l_offset, u64 *l_len)
{
const struct file_lock *fl = &lock->fl;
static void encode_nlm4_holder(struct xdr_stream *xdr,
const struct nlm_res *result)
{
- const struct nlm_lock *lock = &result->lock;
+ const struct lockd_lock *lock = &result->lock;
u64 l_offset, l_len;
__be32 *p;
static int decode_nlm4_holder(struct xdr_stream *xdr, struct nlm_res *result)
{
- struct nlm_lock *lock = &result->lock;
+ struct lockd_lock *lock = &result->lock;
struct file_lock *fl = &lock->fl;
u64 l_offset, l_len;
u32 exclusive;
* };
*/
static void encode_nlm4_lock(struct xdr_stream *xdr,
- const struct nlm_lock *lock)
+ const struct lockd_lock *lock)
{
u64 l_offset, l_len;
__be32 *p;
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_bool(xdr, lock->fl.c.flc_type == F_WRLCK);
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_bool(xdr, args->block);
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_bool(xdr, args->block);
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_nlm4_lock(xdr, lock);
/*
* The server lockd has called us back to tell us the lock was granted
*/
-__be32 nlmclnt_grant(const struct sockaddr *addr, const struct nlm_lock *lock)
+__be32 nlmclnt_grant(const struct sockaddr *addr, const struct lockd_lock *lock)
{
const struct file_lock *fl = &lock->fl;
const struct nfs_fh *fh = &lock->fh;
static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
{
struct nlm_args *argp = &req->a_args;
- struct nlm_lock *lock = &argp->lock;
+ struct lockd_lock *lock = &argp->lock;
char *nodename = req->a_host->h_rpcclnt->cl_nodename;
nlmclnt_next_cookie(&argp->cookie);
return res;
}
-static void nlm_compute_offsets(const struct nlm_lock *lock,
+static void nlm_compute_offsets(const struct lockd_lock *lock,
u32 *l_offset, u32 *l_len)
{
const struct file_lock *fl = &lock->fl;
static void encode_nlm_holder(struct xdr_stream *xdr,
const struct nlm_res *result)
{
- const struct nlm_lock *lock = &result->lock;
+ const struct lockd_lock *lock = &result->lock;
u32 l_offset, l_len;
__be32 *p;
static int decode_nlm_holder(struct xdr_stream *xdr, struct nlm_res *result)
{
- struct nlm_lock *lock = &result->lock;
+ struct lockd_lock *lock = &result->lock;
struct file_lock *fl = &lock->fl;
u32 exclusive, l_offset, l_len;
int error;
* };
*/
static void encode_nlm_lock(struct xdr_stream *xdr,
- const struct nlm_lock *lock)
+ const struct lockd_lock *lock)
{
u32 l_offset, l_len;
__be32 *p;
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_bool(xdr, lock->fl.c.flc_type == F_WRLCK);
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_bool(xdr, args->block);
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_bool(xdr, args->block);
const void *data)
{
const struct nlm_args *args = data;
- const struct nlm_lock *lock = &args->lock;
+ const struct lockd_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie);
encode_nlm_lock(xdr, lock);
__be32 nlmclnt_dequeue_block(struct nlm_wait *block);
int nlmclnt_wait(struct nlm_wait *block, struct nlm_rqst *req, long timeout);
__be32 nlmclnt_grant(const struct sockaddr *addr,
- const struct nlm_lock *lock);
+ const struct lockd_lock *lock);
void nlmclnt_recovery(struct nlm_host *);
int nlmclnt_reclaim(struct nlm_host *, struct file_lock *,
struct nlm_rqst *);
*/
int lock_to_openmode(struct file_lock *);
__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
- struct nlm_host *, struct nlm_lock *, int,
+ struct nlm_host *, struct lockd_lock *, int,
struct lockd_cookie *, int);
-__be32 nlmsvc_unlock(struct net *net, struct nlm_file *, struct nlm_lock *);
+__be32 nlmsvc_unlock(struct net *net, struct nlm_file *, struct lockd_lock *);
__be32 nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
- struct nlm_host *host, struct nlm_lock *lock,
- struct nlm_lock *conflock);
-__be32 nlmsvc_cancel_blocked(struct net *net, struct nlm_file *, struct nlm_lock *);
+ struct nlm_host *host, struct lockd_lock *lock,
+ struct lockd_lock *conflock);
+__be32 nlmsvc_cancel_blocked(struct net *net, struct nlm_file *, struct lockd_lock *);
void nlmsvc_retry_blocked(struct svc_rqst *rqstp);
void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
nlm_host_match_fn_t match);
* File handling for the server personality
*/
__be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **,
- struct nlm_lock *, int);
+ struct lockd_lock *, int);
void nlm_release_file(struct nlm_file *);
void nlmsvc_put_lockowner(struct nlm_lockowner *);
-void nlmsvc_release_lockowner(struct nlm_lock *);
+void nlmsvc_release_lockowner(struct lockd_lock *);
void nlmsvc_mark_resources(struct net *);
void nlmsvc_free_host_resources(struct nlm_host *);
void nlmsvc_invalidate_all(void);
#include "nlm4xdr_gen.h"
/*
- * Wrapper structures combine xdrgen types with legacy nlm_lock.
+ * Wrapper structures combine xdrgen types with legacy lockd_lock.
* The xdrgen field must be first so the structure can be cast
* to its XDR type for the RPC dispatch layer.
*/
struct nlm4_testargs_wrapper {
struct nlm4_testargs xdrgen;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
static_assert(offsetof(struct nlm4_testargs_wrapper, xdrgen) == 0);
struct nlm4_lockargs_wrapper {
struct nlm4_lockargs xdrgen;
struct lockd_cookie cookie;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
static_assert(offsetof(struct nlm4_lockargs_wrapper, xdrgen) == 0);
struct nlm4_cancargs_wrapper {
struct nlm4_cancargs xdrgen;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
static_assert(offsetof(struct nlm4_cancargs_wrapper, xdrgen) == 0);
struct nlm4_unlockargs_wrapper {
struct nlm4_unlockargs xdrgen;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
static_assert(offsetof(struct nlm4_unlockargs_wrapper, xdrgen) == 0);
struct nlm4_testres_wrapper {
struct nlm4_testres xdrgen;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
struct nlm4_shareargs_wrapper {
struct nlm4_shareargs xdrgen;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
static_assert(offsetof(struct nlm4_shareargs_wrapper, xdrgen) == 0);
}
static __be32
-nlm4_lock_to_nlm_lock(struct nlm_lock *lock, struct nlm4_lock *alock)
+nlm4_lock_to_lockd_lock(struct lockd_lock *lock, struct nlm4_lock *alock)
{
if (alock->fh.len > NFS_MAXFHSIZE)
return nlm_lck_denied;
static __be32
nlm4svc_lookup_file(struct svc_rqst *rqstp, struct nlm_host *host,
- struct nlm_lock *lock, struct nlm_file **filp,
+ struct lockd_lock *lock, struct nlm_file **filp,
struct nlm4_lock *xdr_lock, unsigned char type)
{
bool is_test = (rqstp->rq_proc == NLMPROC4_TEST ||
nlmsvc_release_lockowner(&argp->lock);
if (resp->xdrgen.stat.stat == nlm_lck_denied) {
- struct nlm_lock *conf = &resp->lock;
+ struct lockd_lock *conf = &resp->lock;
struct nlm4_holder *holder = &resp->xdrgen.stat.u.holder;
holder->exclusive = (conf->fl.c.flc_type != F_RDLCK);
resp->xdrgen.cookie = argp->xdrgen.cookie;
- resp->xdrgen.stat.stat = nlm4_lock_to_nlm_lock(&argp->lock,
- &argp->xdrgen.alock);
+ resp->xdrgen.stat.stat = nlm4_lock_to_lockd_lock(&argp->lock,
+ &argp->xdrgen.alock);
if (resp->xdrgen.stat.stat)
goto out;
if (nlm4_netobj_to_cookie(&resp->cookie, &argp->xdrgen.cookie))
goto out;
- if (nlm4_lock_to_nlm_lock(&argp->lock, &argp->xdrgen.alock))
+ if (nlm4_lock_to_lockd_lock(&argp->lock, &argp->xdrgen.alock))
goto out;
resp->status = nlmclnt_grant(svc_addr(rqstp), &argp->lock);
{
struct nlm4_shareargs_wrapper *argp = rqstp->rq_argp;
struct nlm4_shareres_wrapper *resp = rqstp->rq_resp;
- struct nlm_lock *lock = &argp->lock;
+ struct lockd_lock *lock = &argp->lock;
struct nlm_host *host = NULL;
struct nlm_file *file = NULL;
struct nlm4_lock xdr_lock = {
{
struct nlm4_shareargs_wrapper *argp = rqstp->rq_argp;
struct nlm4_shareres_wrapper *resp = rqstp->rq_resp;
- struct nlm_lock *lock = &argp->lock;
+ struct lockd_lock *lock = &argp->lock;
struct nlm4_lock xdr_lock = {
.fh = argp->xdrgen.share.fh,
.oh = argp->xdrgen.share.oh,
static void nlmsvc_insert_block(struct nlm_block *block, unsigned long);
static void nlmsvc_remove_block(struct nlm_block *block);
-static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock);
+static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct lockd_lock *lock);
static void nlmsvc_freegrantargs(struct nlm_rqst *call);
static const struct rpc_call_ops nlmsvc_grant_ops;
* Find a block for a given lock
*/
static struct nlm_block *
-nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock)
+nlmsvc_lookup_block(struct nlm_file *file, struct lockd_lock *lock)
{
struct nlm_block *block;
struct file_lock *fl;
*/
static struct nlm_block *
nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host,
- struct nlm_file *file, struct nlm_lock *lock,
+ struct nlm_file *file, struct lockd_lock *lock,
struct lockd_cookie *cookie)
{
struct nlm_block *block;
}
void
-nlmsvc_release_lockowner(struct nlm_lock *lock)
+nlmsvc_release_lockowner(struct lockd_lock *lock)
{
if (lock->fl.c.flc_owner)
nlmsvc_put_lockowner(lock->fl.c.flc_owner);
* Initialize arguments for GRANTED call. The nlm_rqst structure
* has been cleared already.
*/
-static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock)
+static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct lockd_lock *lock)
{
locks_copy_lock(&call->a_args.lock.fl, &lock->fl);
memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh));
*/
__be32
nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
- struct nlm_host *host, struct nlm_lock *lock, int wait,
+ struct nlm_host *host, struct lockd_lock *lock, int wait,
struct lockd_cookie *cookie, int reclaim)
{
struct inode *inode __maybe_unused = nlmsvc_file_inode(file);
*/
__be32
nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
- struct nlm_host *host, struct nlm_lock *lock,
- struct nlm_lock *conflock)
+ struct nlm_host *host, struct lockd_lock *lock,
+ struct lockd_lock *conflock)
{
int error;
__be32 ret;
* must be removed.
*/
__be32
-nlmsvc_unlock(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
+nlmsvc_unlock(struct net *net, struct nlm_file *file, struct lockd_lock *lock)
{
int error = 0;
* The calling procedure must check whether the file can be closed.
*/
__be32
-nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
+nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct lockd_lock *lock)
{
struct nlm_block *block;
int status = 0;
nlmsvc_grant_blocked(struct nlm_block *block)
{
struct nlm_file *file = block->b_file;
- struct nlm_lock *lock = &block->b_call->a_args.lock;
+ struct lockd_lock *lock = &block->b_call->a_args.lock;
int mode;
int error;
loff_t fl_start, fl_end;
{
struct nlm_host *host = NULL;
struct nlm_file *file = NULL;
- struct nlm_lock *lock = &argp->lock;
+ struct lockd_lock *lock = &argp->lock;
bool is_test = (rqstp->rq_proc == NLMPROC_TEST ||
rqstp->rq_proc == NLMPROC_TEST_MSG);
int mode;
*/
__be32
nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
- struct nlm_lock *lock, int mode)
+ struct lockd_lock *lock, int mode)
{
struct nlm_file *file;
unsigned int hash;
DECLARE_EVENT_CLASS(nlmclnt_lock_event,
TP_PROTO(
- const struct nlm_lock *lock,
+ const struct lockd_lock *lock,
const struct sockaddr *addr,
unsigned int addrlen,
__be32 status
#define DEFINE_NLMCLNT_EVENT(name) \
DEFINE_EVENT(nlmclnt_lock_event, name, \
TP_PROTO( \
- const struct nlm_lock *lock, \
+ const struct lockd_lock *lock, \
const struct sockaddr *addr, \
unsigned int addrlen, \
__be32 status \
}
static bool
-svcxdr_decode_lock(struct xdr_stream *xdr, struct nlm_lock *lock)
+svcxdr_decode_lock(struct xdr_stream *xdr, struct lockd_lock *lock)
{
struct file_lock *fl = &lock->fl;
s32 start, len, end;
}
static bool
-svcxdr_encode_holder(struct xdr_stream *xdr, const struct nlm_lock *lock)
+svcxdr_encode_holder(struct xdr_stream *xdr, const struct lockd_lock *lock)
{
const struct file_lock *fl = &lock->fl;
s32 start, len;
nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{
struct nlm_args *argp = rqstp->rq_argp;
- struct nlm_lock *lock = &argp->lock;
+ struct lockd_lock *lock = &argp->lock;
memset(lock, 0, sizeof(*lock));
locks_init_lock(&lock->fl);
nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{
struct nlm_args *argp = rqstp->rq_argp;
- struct nlm_lock *lock = &argp->lock;
+ struct lockd_lock *lock = &argp->lock;
if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len))
return false;
#define nlm_lck_denied_grace_period cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD)
/* Lock info passed via NLM */
-struct nlm_lock {
+struct lockd_lock {
char * caller;
unsigned int len; /* length of "caller" */
struct nfs_fh fh;
*/
struct nlm_args {
struct lockd_cookie cookie;
- struct nlm_lock lock;
+ struct lockd_lock lock;
u32 block;
u32 reclaim;
u32 state;
struct nlm_res {
struct lockd_cookie cookie;
__be32 status;
- struct nlm_lock lock;
+ struct lockd_lock lock;
};
/*