value = NULL;
}
- if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip)) {
+ if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip,
+ &xfs_default_ifork_ops)) {
dbprintf(_("failed to iget inode %llu\n"),
(unsigned long long)iocur_top->ino);
goto out;
name = argv[optind];
- if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip)) {
+ if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &ip,
+ &xfs_default_ifork_ops)) {
dbprintf(_("failed to iget inode %llu\n"),
(unsigned long long)iocur_top->ino);
goto out;
extern int libxfs_iflush_int (struct xfs_inode *, struct xfs_buf *);
/* Inode Cache Interfaces */
-extern bool libxfs_inode_verify_forks(struct xfs_inode *ip);
+extern bool libxfs_inode_verify_forks(struct xfs_inode *ip,
+ struct xfs_ifork_ops *);
extern int libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
- uint, struct xfs_inode **);
+ uint, struct xfs_inode **,
+ struct xfs_ifork_ops *);
extern void libxfs_iput(struct xfs_inode *);
#define IRELE(ip) libxfs_iput(ip)
*/
bool
libxfs_inode_verify_forks(
- struct xfs_inode *ip)
+ struct xfs_inode *ip,
+ struct xfs_ifork_ops *ops)
{
struct xfs_ifork *ifp;
xfs_failaddr_t fa;
- fa = xfs_ifork_verify_data(ip, &xfs_default_ifork_ops);
+ if (!ops)
+ return true;
+
+ fa = xfs_ifork_verify_data(ip, ops);
if (fa) {
ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
xfs_inode_verifier_error(ip, -EFSCORRUPTED, "data fork",
return false;
}
- fa = xfs_ifork_verify_attr(ip, &xfs_default_ifork_ops);
+ fa = xfs_ifork_verify_attr(ip, ops);
if (fa) {
ifp = XFS_IFORK_PTR(ip, XFS_ATTR_FORK);
xfs_inode_verifier_error(ip, -EFSCORRUPTED, "attr fork",
}
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 lock_flags,
+ struct xfs_inode **ipp,
+ struct xfs_ifork_ops *ifork_ops)
{
- xfs_inode_t *ip;
- int error = 0;
+ struct xfs_inode *ip;
+ int error = 0;
ip = kmem_zone_zalloc(xfs_inode_zone, 0);
if (!ip)
return error;
}
- if (!libxfs_inode_verify_forks(ip)) {
+ if (!libxfs_inode_verify_forks(ip, ifork_ops)) {
libxfs_iput(ip);
return -EFSCORRUPTED;
}
xfs_inode_log_item_t *iip;
if (tp == NULL)
- return libxfs_iget(mp, tp, ino, lock_flags, ipp);
+ return libxfs_iget(mp, tp, ino, lock_flags, ipp,
+ &xfs_default_ifork_ops);
- error = libxfs_iget(mp, tp, ino, lock_flags, &ip);
+ error = libxfs_iget(mp, tp, ino, lock_flags, &ip,
+ &xfs_default_ifork_ops);
if (error)
return error;
ASSERT(ip != NULL);
VFS_I(ip)->i_version++;
/* Check the inline fork data before we write out. */
- if (!libxfs_inode_verify_forks(ip))
+ if (!libxfs_inode_verify_forks(ip, &xfs_default_ifork_ops))
return -EFSCORRUPTED;
/*
* would have been cleared in phase3 and phase4.
*/
- if ((i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip)))
+ i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip,
+ &xfs_default_ifork_ops);
+ if (i)
do_error(_("%d - couldn't iget root inode to obtain %s\n"),
i, ORPHANAGE);
* 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)))
+/* i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip,
+ &xfs_default_ifork_ops);
+ if (i)
do_error(_("%d - couldn't iget root inode to make %s\n"),
i, 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, &orphanage_ip,
+ &xfs_default_ifork_ops);
if (err)
do_error(_("%d - couldn't iget orphanage inode\n"), err);
/*
xname.len = snprintf((char *)fname, sizeof(fname), "%llu.%d",
(unsigned long long)ino, ++incr);
- if ((err = -libxfs_iget(mp, NULL, ino, 0, &ino_p)))
+ err = -libxfs_iget(mp, NULL, ino, 0, &ino_p, &xfs_default_ifork_ops);
+ if (err)
do_error(_("%d - couldn't iget disconnected inode\n"), err);
xname.type = libxfs_mode_to_ftype(VFS_I(ino_p)->i_mode);
ASSERT(!is_inode_refchecked(irec, ino_offset) || dotdot_update);
- error = -libxfs_iget(mp, NULL, ino, 0, &ip);
+ error = -libxfs_iget(mp, NULL, ino, 0, &ip, NULL);
if (error) {
if (!no_modify)
do_error(