Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cae80b30 authored by Jeff Layton's avatar Jeff Layton
Browse files

locks: change lm_get_owner and lm_put_owner prototypes



The current prototypes for these operations are somewhat awkward as they
deal with fl_owners but take struct file_lock arguments. In the future,
we'll want to be able to take references without necessarily dealing
with a struct file_lock.

Change them to take fl_owner_t arguments instead and have the callers
deal with assigning the values to the file_lock structs.

Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
parent 5c1c669a
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -276,8 +276,10 @@ void locks_release_private(struct file_lock *fl)
	}
	}


	if (fl->fl_lmops) {
	if (fl->fl_lmops) {
		if (fl->fl_lmops->lm_put_owner)
		if (fl->fl_lmops->lm_put_owner) {
			fl->fl_lmops->lm_put_owner(fl);
			fl->fl_lmops->lm_put_owner(fl->fl_owner);
			fl->fl_owner = NULL;
		}
		fl->fl_lmops = NULL;
		fl->fl_lmops = NULL;
	}
	}
}
}
@@ -333,7 +335,7 @@ void locks_copy_conflock(struct file_lock *new, struct file_lock *fl)


	if (fl->fl_lmops) {
	if (fl->fl_lmops) {
		if (fl->fl_lmops->lm_get_owner)
		if (fl->fl_lmops->lm_get_owner)
			fl->fl_lmops->lm_get_owner(new, fl);
			fl->fl_lmops->lm_get_owner(fl->fl_owner);
	}
	}
}
}
EXPORT_SYMBOL(locks_copy_conflock);
EXPORT_SYMBOL(locks_copy_conflock);
+10 −8
Original line number Original line Diff line number Diff line
@@ -4932,20 +4932,22 @@ nfs4_transform_lock_offset(struct file_lock *lock)
		lock->fl_end = OFFSET_MAX;
		lock->fl_end = OFFSET_MAX;
}
}


static void nfsd4_fl_get_owner(struct file_lock *dst, struct file_lock *src)
static fl_owner_t
nfsd4_fl_get_owner(fl_owner_t owner)
{
{
	struct nfs4_lockowner *lo = (struct nfs4_lockowner *)src->fl_owner;
	struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;
	dst->fl_owner = (fl_owner_t)lockowner(nfs4_get_stateowner(&lo->lo_owner));

	nfs4_get_stateowner(&lo->lo_owner);
	return owner;
}
}


static void nfsd4_fl_put_owner(struct file_lock *fl)
static void
nfsd4_fl_put_owner(fl_owner_t owner)
{
{
	struct nfs4_lockowner *lo = (struct nfs4_lockowner *)fl->fl_owner;
	struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;


	if (lo) {
	if (lo)
		nfs4_put_stateowner(&lo->lo_owner);
		nfs4_put_stateowner(&lo->lo_owner);
		fl->fl_owner = NULL;
	}
}
}


static const struct lock_manager_operations nfsd_posix_mng_ops  = {
static const struct lock_manager_operations nfsd_posix_mng_ops  = {
+2 −2
Original line number Original line Diff line number Diff line
@@ -893,8 +893,8 @@ struct file_lock_operations {
struct lock_manager_operations {
struct lock_manager_operations {
	int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
	int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
	unsigned long (*lm_owner_key)(struct file_lock *);
	unsigned long (*lm_owner_key)(struct file_lock *);
	void (*lm_get_owner)(struct file_lock *, struct file_lock *);
	fl_owner_t (*lm_get_owner)(fl_owner_t);
	void (*lm_put_owner)(struct file_lock *);
	void (*lm_put_owner)(fl_owner_t);
	void (*lm_notify)(struct file_lock *);	/* unblock callback */
	void (*lm_notify)(struct file_lock *);	/* unblock callback */
	int (*lm_grant)(struct file_lock *, int);
	int (*lm_grant)(struct file_lock *, int);
	bool (*lm_break)(struct file_lock *);
	bool (*lm_break)(struct file_lock *);