fs/lockd/svcproc.c

Source file repositories/reference/linux-study-clean/fs/lockd/svcproc.c

File Facts

System
Linux kernel
Corpus path
fs/lockd/svcproc.c
Extension
.c
Size
40178 bytes
Lines
1458
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct nlm_testargs_wrapper {
	struct nlm_testargs		xdrgen;
	struct lockd_lock		lock;
};

static_assert(offsetof(struct nlm_testargs_wrapper, xdrgen) == 0);

struct nlm_testres_wrapper {
	struct nlm_testres		xdrgen;
	struct lockd_lock		lock;
};

static_assert(offsetof(struct nlm_testres_wrapper, xdrgen) == 0);

struct nlm_lockargs_wrapper {
	struct nlm_lockargs		xdrgen;
	struct lockd_cookie		cookie;
	struct lockd_lock		lock;
};

static_assert(offsetof(struct nlm_lockargs_wrapper, xdrgen) == 0);

struct nlm_res_wrapper {
	struct nlm_res			xdrgen;
	struct lockd_cookie		cookie;
};

static_assert(offsetof(struct nlm_res_wrapper, xdrgen) == 0);

struct nlm_cancargs_wrapper {
	struct nlm_cancargs		xdrgen;
	struct lockd_lock		lock;
};

static_assert(offsetof(struct nlm_cancargs_wrapper, xdrgen) == 0);

struct nlm_unlockargs_wrapper {
	struct nlm_unlockargs		xdrgen;
	struct lockd_lock		lock;
};

static_assert(offsetof(struct nlm_unlockargs_wrapper, xdrgen) == 0);

struct nlm_notifyargs_wrapper {
	struct nlm_notifyargs		xdrgen;
	struct lockd_reboot		reboot;
};

static_assert(offsetof(struct nlm_notifyargs_wrapper, xdrgen) == 0);

struct nlm_shareargs_wrapper {
	struct nlm_shareargs		xdrgen;
	struct lockd_lock		lock;
};

static_assert(offsetof(struct nlm_shareargs_wrapper, xdrgen) == 0);

struct nlm_shareres_wrapper {
	struct nlm_shareres		xdrgen;
};

static_assert(offsetof(struct nlm_shareres_wrapper, xdrgen) == 0);

struct nlm_notify_wrapper {
	struct nlm_notify		xdrgen;
};

static_assert(offsetof(struct nlm_notify_wrapper, xdrgen) == 0);

static __be32
nlm_netobj_to_cookie(struct lockd_cookie *cookie, netobj *object)
{
	if (object->len > NLM_MAXCOOKIELEN)
		return nlm_lck_denied_nolocks;
	cookie->len = object->len;
	memcpy(cookie->data, object->data, object->len);
	return nlm_granted;
}

static __be32
nlm_lock_to_lockd_lock(struct lockd_lock *lock, struct nlm_lock *alock)
{
	if (alock->fh.len != NLM3_FHSIZE)
		return nlm_lck_denied;
	lock->fh.size = alock->fh.len;
	memcpy(lock->fh.data, alock->fh.data, alock->fh.len);
	lock->oh.len = alock->oh.len;
	lock->oh.data = alock->oh.data;
	lock->svid = alock->uppid;
	lockd_set_file_lock_range3(&lock->fl, alock->l_offset, alock->l_len);

Annotation

Implementation Notes