* netobj cookie;
*/
static void encode_cookie(struct xdr_stream *xdr,
- const struct nlm_cookie *cookie)
+ const struct lockd_cookie *cookie)
{
encode_netobj(xdr, (u8 *)&cookie->data, cookie->len);
}
static int decode_cookie(struct xdr_stream *xdr,
- struct nlm_cookie *cookie)
+ struct lockd_cookie *cookie)
{
u32 length;
__be32 *p;
*/
static atomic_t nlm_cookie = ATOMIC_INIT(0x1234);
-void nlmclnt_next_cookie(struct nlm_cookie *c)
+void nlmclnt_next_cookie(struct lockd_cookie *c)
{
u32 cookie = atomic_inc_return(&nlm_cookie);
* netobj cookie;
*/
static void encode_cookie(struct xdr_stream *xdr,
- const struct nlm_cookie *cookie)
+ const struct lockd_cookie *cookie)
{
encode_netobj(xdr, (u8 *)&cookie->data, cookie->len);
}
static int decode_cookie(struct xdr_stream *xdr,
- struct nlm_cookie *cookie)
+ struct lockd_cookie *cookie)
{
u32 length;
__be32 *p;
void nlmclnt_recovery(struct nlm_host *);
int nlmclnt_reclaim(struct nlm_host *, struct file_lock *,
struct nlm_rqst *);
-void nlmclnt_next_cookie(struct nlm_cookie *);
+void nlmclnt_next_cookie(struct lockd_cookie *);
#ifdef CONFIG_LOCKD_V4
extern const struct rpc_version nlm_version4;
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_cookie *, int);
+ struct lockd_cookie *, int);
__be32 nlmsvc_unlock(struct net *net, struct nlm_file *, struct nlm_lock *);
__be32 nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
struct nlm_host *host, struct nlm_lock *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);
-void nlmsvc_grant_reply(struct nlm_cookie *, __be32);
+void nlmsvc_grant_reply(struct lockd_cookie *, __be32);
void nlmsvc_release_call(struct nlm_rqst *);
void nlmsvc_locks_init_private(struct file_lock *, struct nlm_host *, pid_t);
int nlmsvc_dispatch(struct svc_rqst *rqstp);
struct nlm4_lockargs_wrapper {
struct nlm4_lockargs xdrgen;
- struct nlm_cookie cookie;
+ struct lockd_cookie cookie;
struct nlm_lock lock;
};
struct nlm4_res_wrapper {
struct nlm4_res xdrgen;
- struct nlm_cookie cookie;
+ struct lockd_cookie cookie;
};
static_assert(offsetof(struct nlm4_res_wrapper, xdrgen) == 0);
static_assert(offsetof(struct nlm4_shareres_wrapper, xdrgen) == 0);
static __be32
-nlm4_netobj_to_cookie(struct nlm_cookie *cookie, netobj *object)
+nlm4_netobj_to_cookie(struct lockd_cookie *cookie, netobj *object)
{
if (object->len > NLM_MAXCOOKIELEN)
return nlm_lck_denied_nolocks;
static DEFINE_SPINLOCK(nlm_blocked_lock);
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie)
+static const char *nlmdbg_cookie2a(const struct lockd_cookie *cookie)
{
/*
* We can get away with a static buffer because this is only called
return buf;
}
#else
-static inline const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie)
+static inline const char *nlmdbg_cookie2a(const struct lockd_cookie *cookie)
{
return "???";
}
return NULL;
}
-static inline int nlm_cookie_match(struct nlm_cookie *a, struct nlm_cookie *b)
+static int lockd_cookie_match(struct lockd_cookie *a, struct lockd_cookie *b)
{
if (a->len != b->len)
return 0;
* Find a block with a given NLM cookie.
*/
static inline struct nlm_block *
-nlmsvc_find_block(struct nlm_cookie *cookie)
+nlmsvc_find_block(struct lockd_cookie *cookie)
{
struct nlm_block *block;
spin_lock(&nlm_blocked_lock);
list_for_each_entry(block, &nlm_blocked, b_list) {
- if (nlm_cookie_match(&block->b_call->a_args.cookie,cookie))
+ if (lockd_cookie_match(&block->b_call->a_args.cookie, cookie))
goto found;
}
spin_unlock(&nlm_blocked_lock);
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_cookie *cookie)
+ struct lockd_cookie *cookie)
{
struct nlm_block *block;
struct nlm_rqst *call = NULL;
__be32
nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
struct nlm_host *host, struct nlm_lock *lock, int wait,
- struct nlm_cookie *cookie, int reclaim)
+ struct lockd_cookie *cookie, int reclaim)
{
struct inode *inode __maybe_unused = nlmsvc_file_inode(file);
struct nlm_block *block = NULL;
* block.
*/
void
-nlmsvc_grant_reply(struct nlm_cookie *cookie, __be32 status)
+nlmsvc_grant_reply(struct lockd_cookie *cookie, __be32 status)
{
struct nlm_block *block;
struct file_lock *fl;
* specially.
*/
static inline bool
-svcxdr_decode_cookie(struct xdr_stream *xdr, struct nlm_cookie *cookie)
+svcxdr_decode_cookie(struct xdr_stream *xdr, struct lockd_cookie *cookie)
{
__be32 *p;
u32 len;
}
static inline bool
-svcxdr_encode_cookie(struct xdr_stream *xdr, const struct nlm_cookie *cookie)
+svcxdr_encode_cookie(struct xdr_stream *xdr, const struct lockd_cookie *cookie)
{
__be32 *p;
* 32 bytes.
*/
-struct nlm_cookie
-{
+struct lockd_cookie {
unsigned char data[NLM_MAXCOOKIELEN];
unsigned int len;
};
* Generic lockd arguments for all but sm_notify
*/
struct nlm_args {
- struct nlm_cookie cookie;
+ struct lockd_cookie cookie;
struct nlm_lock lock;
u32 block;
u32 reclaim;
* Generic lockd result
*/
struct nlm_res {
- struct nlm_cookie cookie;
+ struct lockd_cookie cookie;
__be32 status;
struct nlm_lock lock;
};