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

fs: remove locks_inode



locks_inode was turned into a wrapper around file_inode in de2a4a50
(Partially revert "locks: fix file locking on overlayfs"). Finish
replacing locks_inode invocations everywhere with file_inode.

Acked-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
parent 5970e15d
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ static int afs_do_setlk_check(struct afs_vnode *vnode, struct key *key,
 */
static int afs_do_setlk(struct file *file, struct file_lock *fl)
{
	struct inode *inode = locks_inode(file);
	struct inode *inode = file_inode(file);
	struct afs_vnode *vnode = AFS_FS_I(inode);
	enum afs_flock_mode mode = AFS_FS_S(inode->i_sb)->flock_mode;
	afs_lock_type_t type;
@@ -701,7 +701,7 @@ static int afs_do_setlk(struct file *file, struct file_lock *fl)
 */
static int afs_do_unlk(struct file *file, struct file_lock *fl)
{
	struct afs_vnode *vnode = AFS_FS_I(locks_inode(file));
	struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
	int ret;

	_enter("{%llx:%llu},%u", vnode->fid.vid, vnode->fid.vnode, fl->fl_type);
@@ -721,7 +721,7 @@ static int afs_do_unlk(struct file *file, struct file_lock *fl)
 */
static int afs_do_getlk(struct file *file, struct file_lock *fl)
{
	struct afs_vnode *vnode = AFS_FS_I(locks_inode(file));
	struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
	struct key *key = afs_file_key(file);
	int ret, lock_count;

@@ -763,7 +763,7 @@ static int afs_do_getlk(struct file *file, struct file_lock *fl)
 */
int afs_lock(struct file *file, int cmd, struct file_lock *fl)
{
	struct afs_vnode *vnode = AFS_FS_I(locks_inode(file));
	struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
	enum afs_flock_operation op;
	int ret;

@@ -798,7 +798,7 @@ int afs_lock(struct file *file, int cmd, struct file_lock *fl)
 */
int afs_flock(struct file *file, int cmd, struct file_lock *fl)
{
	struct afs_vnode *vnode = AFS_FS_I(locks_inode(file));
	struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
	enum afs_flock_operation op;
	int ret;

@@ -843,7 +843,7 @@ int afs_flock(struct file *file, int cmd, struct file_lock *fl)
 */
static void afs_fl_copy_lock(struct file_lock *new, struct file_lock *fl)
{
	struct afs_vnode *vnode = AFS_FS_I(locks_inode(fl->fl_file));
	struct afs_vnode *vnode = AFS_FS_I(file_inode(fl->fl_file));

	_enter("");

@@ -861,7 +861,7 @@ static void afs_fl_copy_lock(struct file_lock *new, struct file_lock *fl)
 */
static void afs_fl_release_private(struct file_lock *fl)
{
	struct afs_vnode *vnode = AFS_FS_I(locks_inode(fl->fl_file));
	struct afs_vnode *vnode = AFS_FS_I(file_inode(fl->fl_file));

	_enter("");

+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ __be32 nlmclnt_grant(const struct sockaddr *addr, const struct nlm_lock *lock)
			continue;
		if (!rpc_cmp_addr(nlm_addr(block->b_host), addr))
			continue;
		if (nfs_compare_fh(NFS_FH(locks_inode(fl_blocked->fl_file)), fh) != 0)
		if (nfs_compare_fh(NFS_FH(file_inode(fl_blocked->fl_file)), fh) != 0)
			continue;
		/* Alright, we found a lock. Set the return status
		 * and wake up the caller
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
	char *nodename = req->a_host->h_rpcclnt->cl_nodename;

	nlmclnt_next_cookie(&argp->cookie);
	memcpy(&lock->fh, NFS_FH(locks_inode(fl->fl_file)), sizeof(struct nfs_fh));
	memcpy(&lock->fh, NFS_FH(file_inode(fl->fl_file)), sizeof(struct nfs_fh));
	lock->caller  = nodename;
	lock->oh.data = req->a_owner;
	lock->oh.len  = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
+14 −14
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ locks_check_ctx_file_list(struct file *filp, struct list_head *list,
				char *list_type)
{
	struct file_lock *fl;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);

	list_for_each_entry(fl, list, fl_list)
		if (fl->fl_file == filp)
@@ -888,7 +888,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
{
	struct file_lock *cfl;
	struct file_lock_context *ctx;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	void *owner;
	void (*func)(void);

@@ -1331,7 +1331,7 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request,
int posix_lock_file(struct file *filp, struct file_lock *fl,
			struct file_lock *conflock)
{
	return posix_lock_inode(locks_inode(filp), fl, conflock);
	return posix_lock_inode(file_inode(filp), fl, conflock);
}
EXPORT_SYMBOL(posix_lock_file);

@@ -1630,7 +1630,7 @@ EXPORT_SYMBOL(lease_get_mtime);
int fcntl_getlease(struct file *filp)
{
	struct file_lock *fl;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	struct file_lock_context *ctx;
	int type = F_UNLCK;
	LIST_HEAD(dispose);
@@ -1668,7 +1668,7 @@ int fcntl_getlease(struct file *filp)
static int
check_conflicting_open(struct file *filp, const long arg, int flags)
{
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	int self_wcount = 0, self_rcount = 0;

	if (flags & FL_LAYOUT)
@@ -1704,7 +1704,7 @@ static int
generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv)
{
	struct file_lock *fl, *my_fl = NULL, *lease;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	struct file_lock_context *ctx;
	bool is_deleg = (*flp)->fl_flags & FL_DELEG;
	int error;
@@ -1820,7 +1820,7 @@ static int generic_delete_lease(struct file *filp, void *owner)
{
	int error = -EAGAIN;
	struct file_lock *fl, *victim = NULL;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	struct file_lock_context *ctx;
	LIST_HEAD(dispose);

@@ -1862,7 +1862,7 @@ static int generic_delete_lease(struct file *filp, void *owner)
int generic_setlease(struct file *filp, long arg, struct file_lock **flp,
			void **priv)
{
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	int error;

	if ((!uid_eq(current_fsuid(), inode->i_uid)) && !capable(CAP_LEASE))
@@ -2351,7 +2351,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
		struct flock *flock)
{
	struct file_lock *file_lock = locks_alloc_lock();
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	struct file *f;
	int error;

@@ -2555,7 +2555,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
void locks_remove_posix(struct file *filp, fl_owner_t owner)
{
	int error;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	struct file_lock lock;
	struct file_lock_context *ctx;

@@ -2592,7 +2592,7 @@ static void
locks_remove_flock(struct file *filp, struct file_lock_context *flctx)
{
	struct file_lock fl;
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);

	if (list_empty(&flctx->flc_flock))
		return;
@@ -2637,7 +2637,7 @@ void locks_remove_file(struct file *filp)
{
	struct file_lock_context *ctx;

	ctx = locks_inode_context(locks_inode(filp));
	ctx = locks_inode_context(file_inode(filp));
	if (!ctx)
		return;

@@ -2721,7 +2721,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
	 */

	if (fl->fl_file != NULL)
		inode = locks_inode(fl->fl_file);
		inode = file_inode(fl->fl_file);

	seq_printf(f, "%lld: ", id);

@@ -2862,7 +2862,7 @@ static void __show_fd_locks(struct seq_file *f,
void show_fd_locks(struct seq_file *f,
		  struct file *filp, struct files_struct *files)
{
	struct inode *inode = locks_inode(filp);
	struct inode *inode = file_inode(filp);
	struct file_lock_context *ctx;
	int id = 0;

+2 −2
Original line number Diff line number Diff line
@@ -5374,7 +5374,7 @@ static int nfsd4_check_conflicting_opens(struct nfs4_client *clp,
{
	struct nfs4_ol_stateid *st;
	struct file *f = fp->fi_deleg_file->nf_file;
	struct inode *ino = locks_inode(f);
	struct inode *ino = file_inode(f);
	int writes;

	writes = atomic_read(&ino->i_writecount);
@@ -7828,7 +7828,7 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)
		return status;
	}

	inode = locks_inode(nf->nf_file);
	inode = file_inode(nf->nf_file);
	flctx = locks_inode_context(inode);

	if (flctx && !list_empty_careful(&flctx->flc_posix)) {
Loading