linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libxfs: add a flags argument to libxfs_iget
@ 2017-07-18 19:06 Darrick J. Wong
  2017-07-18 19:06 ` [PATCH 2/2] libxfs: allow xfs_repair to bypass inode fork read verifiers Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Darrick J. Wong @ 2017-07-18 19:06 UTC (permalink / raw)
  To: sandeen; +Cc: linux-xfs, bfoster

From: Darrick J. Wong <darrick.wong@oracle.com>

Add a flags argument to libxfs_iget to bring it up to date with the
kernel xfs_iget.  We will use the flags argument in the next patch
to enable xfs_repair to shut off inode fork verifiers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/attrset.c        |    4 ++--
 include/xfs_inode.h |    2 +-
 libxfs/rdwr.c       |   15 ++++++++++-----
 libxfs/trans.c      |    4 ++--
 repair/phase6.c     |   10 +++++-----
 5 files changed, 20 insertions(+), 15 deletions(-)


diff --git a/db/attrset.c b/db/attrset.c
index ad3c8f3..ddd72ed 100644
--- a/db/attrset.c
+++ b/db/attrset.c
@@ -151,7 +151,7 @@ attr_set_f(
 		value = NULL;
 	}
 
-	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip)) {
+	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, 0, &ip)) {
 		dbprintf(_("failed to iget inode %llu\n"),
 			(unsigned long long)iocur_top->ino);
 		goto out;
@@ -226,7 +226,7 @@ attr_remove_f(
 
 	name = argv[optind];
 
-	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip)) {
+	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, 0, &ip)) {
 		dbprintf(_("failed to iget inode %llu\n"),
 			(unsigned long long)iocur_top->ino);
 		goto out;
diff --git a/include/xfs_inode.h b/include/xfs_inode.h
index 8766024..5d5158e 100644
--- a/include/xfs_inode.h
+++ b/include/xfs_inode.h
@@ -149,7 +149,7 @@ extern int	libxfs_iflush_int (struct xfs_inode *, struct xfs_buf *);
 
 /* Inode Cache Interfaces */
 extern int	libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
-				uint, struct xfs_inode **);
+				uint, uint, struct xfs_inode **);
 extern void	libxfs_iput(struct xfs_inode *);
 
 #define IRELE(ip) libxfs_iput(ip)
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 43b4f1d..cf156ba 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -1329,11 +1329,16 @@ extern kmem_zone_t	*xfs_ili_zone;
 extern kmem_zone_t	*xfs_inode_zone;
 
 int
-libxfs_iget(xfs_mount_t *mp, xfs_trans_t *tp, xfs_ino_t ino, uint lock_flags,
-		xfs_inode_t **ipp)
+libxfs_iget(
+	struct xfs_mount	*mp,
+	struct xfs_trans	*tp,
+	xfs_ino_t		ino,
+	uint			flags,
+	uint			lock_flags,
+	struct xfs_inode	**ipp)
 {
-	xfs_inode_t	*ip;
-	int		error = 0;
+	struct xfs_inode	*ip;
+	int			error = 0;
 
 	ip = kmem_zone_zalloc(xfs_inode_zone, 0);
 	if (!ip)
@@ -1341,7 +1346,7 @@ libxfs_iget(xfs_mount_t *mp, xfs_trans_t *tp, xfs_ino_t ino, uint lock_flags,
 
 	ip->i_ino = ino;
 	ip->i_mount = mp;
-	error = xfs_iread(mp, tp, ip, 0);
+	error = xfs_iread(mp, tp, ip, flags);
 	if (error) {
 		kmem_zone_free(xfs_inode_zone, ip);
 		*ipp = NULL;
diff --git a/libxfs/trans.c b/libxfs/trans.c
index e161c28..fe22cb9 100644
--- a/libxfs/trans.c
+++ b/libxfs/trans.c
@@ -246,9 +246,9 @@ libxfs_trans_iget(
 	xfs_inode_log_item_t	*iip;
 
 	if (tp == NULL)
-		return libxfs_iget(mp, tp, ino, lock_flags, ipp);
+		return libxfs_iget(mp, tp, ino, flags, lock_flags, ipp);
 
-	error = libxfs_iget(mp, tp, ino, lock_flags, &ip);
+	error = libxfs_iget(mp, tp, ino, flags, lock_flags, &ip);
 	if (error)
 		return error;
 	ASSERT(ip != NULL);
diff --git a/repair/phase6.c b/repair/phase6.c
index 373b1a5..011bcdf 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -925,7 +925,7 @@ mk_orphanage(xfs_mount_t *mp)
 	 * would have been cleared in phase3 and phase4.
 	 */
 
-	if ((i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip)))
+	if ((i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, 0, &pip)))
 		do_error(_("%d - couldn't iget root inode to obtain %s\n"),
 			i, ORPHANAGE);
 
@@ -949,7 +949,7 @@ mk_orphanage(xfs_mount_t *mp)
 	 * use iget/ijoin instead of trans_iget because the ialloc
 	 * wrapper can commit the transaction and start a new one
 	 */
-/*	if ((i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip)))
+/*	if ((i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, 0, &pip)))
 		do_error(_("%d - couldn't iget root inode to make %s\n"),
 			i, ORPHANAGE);*/
 
@@ -1063,7 +1063,7 @@ mv_orphanage(
 	xname.len = snprintf((char *)fname, sizeof(fname), "%llu",
 				(unsigned long long)ino);
 
-	err = -libxfs_iget(mp, NULL, orphanage_ino, 0, &orphanage_ip);
+	err = -libxfs_iget(mp, NULL, orphanage_ino, 0, 0, &orphanage_ip);
 	if (err)
 		do_error(_("%d - couldn't iget orphanage inode\n"), err);
 	/*
@@ -1075,7 +1075,7 @@ mv_orphanage(
 		xname.len = snprintf((char *)fname, sizeof(fname), "%llu.%d",
 					(unsigned long long)ino, ++incr);
 
-	if ((err = -libxfs_iget(mp, NULL, ino, 0, &ino_p)))
+	if ((err = -libxfs_iget(mp, NULL, ino, 0, 0, &ino_p)))
 		do_error(_("%d - couldn't iget disconnected inode\n"), err);
 
 	xname.type = xfs_mode_to_ftype(VFS_I(ino_p)->i_mode);
@@ -2817,7 +2817,7 @@ process_dir_inode(
 
 	ASSERT(!is_inode_refchecked(irec, ino_offset) || dotdot_update);
 
-	error = -libxfs_iget(mp, NULL, ino, 0, &ip);
+	error = -libxfs_iget(mp, NULL, ino, 0, 0, &ip);
 	if (error) {
 		if (!no_modify)
 			do_error(


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-19  2:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 19:06 [PATCH 1/2] libxfs: add a flags argument to libxfs_iget Darrick J. Wong
2017-07-18 19:06 ` [PATCH 2/2] libxfs: allow xfs_repair to bypass inode fork read verifiers Darrick J. Wong
2017-07-18 19:51   ` Allison Henderson
2017-07-18 19:50 ` [PATCH 1/2] libxfs: add a flags argument to libxfs_iget Allison Henderson
2017-07-19  2:24 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).