Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Apr 2022 02:18:40 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3d0801e86e7e - stable/13 - lockf: remove lf_inode from struct lockf_entry
Message-ID:  <202204160218.23G2IeXu025348@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3d0801e86e7ee0207a3011717105b399da78f73e

commit 3d0801e86e7ee0207a3011717105b399da78f73e
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-04-01 20:34:59 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-04-16 02:18:18 +0000

    lockf: remove lf_inode from struct lockf_entry
    
    (cherry picked from commit 59e85819be69d354fa6f390b791fd9cd06a80f35)
---
 sys/kern/kern_lockf.c | 20 +++-----------------
 sys/sys/lockf.h       |  1 -
 2 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index 8a54e4700d20..079f7b999835 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -571,13 +571,6 @@ retry_setlock:
 		vref(vp);
 	}
 
-	/*
-	 * XXX The problem is that VTOI is ufs specific, so it will
-	 * break LOCKF_DEBUG for all other FS's other than UFS because
-	 * it casts the vnode->data ptr to struct inode *.
-	 */
-/*	lock->lf_inode = VTOI(ap->a_vp); */
-	lock->lf_inode = (struct inode *)0;
 	lock->lf_type = fl->l_type;
 	LIST_INIT(&lock->lf_outedges);
 	LIST_INIT(&lock->lf_inedges);
@@ -2498,10 +2491,8 @@ lf_print(char *tag, struct lockf_entry *lock)
 
 	printf("%s: lock %p for ", tag, (void *)lock);
 	lf_print_owner(lock->lf_owner);
-	if (lock->lf_inode != (struct inode *)0)
-		printf(" in ino %ju on dev <%s>,",
-		    (uintmax_t)lock->lf_inode->i_number,
-		    devtoname(ITODEV(lock->lf_inode)));
+	printf("\nvnode %p", lock->lf_vnode);
+	VOP_PRINT(lock->lf_vnode);
 	printf(" %s, start %jd, end ",
 	    lock->lf_type == F_RDLCK ? "shared" :
 	    lock->lf_type == F_WRLCK ? "exclusive" :
@@ -2524,12 +2515,7 @@ lf_printlist(char *tag, struct lockf_entry *lock)
 	struct lockf_entry *lf, *blk;
 	struct lockf_edge *e;
 
-	if (lock->lf_inode == (struct inode *)0)
-		return;
-
-	printf("%s: Lock list for ino %ju on dev <%s>:\n",
-	    tag, (uintmax_t)lock->lf_inode->i_number,
-	    devtoname(ITODEV(lock->lf_inode)));
+	printf("%s: Lock list for vnode %p:\n", tag, lock->lf_vnode);
 	LIST_FOREACH(lf, &lock->lf_vnode->v_lockf->ls_active, lf_link) {
 		printf("\tlock %p for ",(void *)lf);
 		lf_print_owner(lock->lf_owner);
diff --git a/sys/sys/lockf.h b/sys/sys/lockf.h
index 368c773283ec..cca02501a462 100644
--- a/sys/sys/lockf.h
+++ b/sys/sys/lockf.h
@@ -77,7 +77,6 @@ struct lockf_entry {
 	off_t	lf_end;		    /* (s) Byte # of the end of the lock (OFF_MAX=EOF) */
 	struct	lock_owner *lf_owner; /* (c) Owner of the lock */
 	struct	vnode *lf_vnode;    /* (c) File being locked (only valid for active lock) */
-	struct	inode *lf_inode;    /* (c) Back pointer to the inode */
 	struct	task *lf_async_task;/* (c) Async lock callback */
 	LIST_ENTRY(lockf_entry) lf_link;  /* (s) Linkage for lock lists */
 	struct lockf_edge_list lf_outedges; /* (s) list of out-edges */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204160218.23G2IeXu025348>