From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@redhat.com
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: [PATCH 1/2] libxfs: add a flags argument to libxfs_iget
Date: Tue, 18 Jul 2017 12:06:45 -0700 [thread overview]
Message-ID: <150040480534.16432.7424988688113046337.stgit@magnolia> (raw)
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(
next reply other threads:[~2017-07-18 19:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 19:06 Darrick J. Wong [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=150040480534.16432.7424988688113046337.stgit@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.