memset(args.value, 'v', args.valuelen);
}
- if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp,
- &xfs_default_ifork_ops)) {
+ if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp)) {
dbprintf(_("failed to iget inode %llu\n"),
(unsigned long long)iocur_top->ino);
goto out;
return 0;
}
- if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp,
- &xfs_default_ifork_ops)) {
+ if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp)) {
dbprintf(_("failed to iget inode %llu\n"),
(unsigned long long)iocur_top->ino);
goto out;
unsigned int i_cformat; /* format of cow fork */
xfs_fsize_t i_size; /* in-memory size */
- struct xfs_ifork_ops *i_fork_ops; /* fork verifiers */
struct inode i_vnode;
} xfs_inode_t;
/* Inode Cache Interfaces */
extern bool libxfs_inode_verify_forks(struct xfs_inode *ip);
extern int libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
- uint, struct xfs_inode **,
- struct xfs_ifork_ops *);
+ uint, struct xfs_inode **);
extern void libxfs_irele(struct xfs_inode *ip);
#endif /* __XFS_INODE_H__ */
#define xfs_da_hashname libxfs_da_hashname
#define xfs_da_read_buf libxfs_da_read_buf
#define xfs_da_shrink_inode libxfs_da_shrink_inode
-#define xfs_default_ifork_ops libxfs_default_ifork_ops
#define xfs_defer_cancel libxfs_defer_cancel
#define xfs_defer_finish libxfs_defer_finish
#define xfs_dinode_calc_crc libxfs_dinode_calc_crc
struct xfs_ifork *ifp;
xfs_failaddr_t fa;
- if (!ip->i_fork_ops)
- return true;
-
- fa = xfs_ifork_verify_data(ip, ip->i_fork_ops);
+ fa = xfs_ifork_verify_data(ip);
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, ip->i_fork_ops);
+ fa = xfs_ifork_verify_attr(ip);
if (fa) {
ifp = XFS_IFORK_PTR(ip, XFS_ATTR_FORK);
xfs_inode_verifier_error(ip, -EFSCORRUPTED, "attr fork",
struct xfs_trans *tp,
xfs_ino_t ino,
uint lock_flags,
- struct xfs_inode **ipp,
- struct xfs_ifork_ops *ifork_ops)
+ struct xfs_inode **ipp)
{
struct xfs_inode *ip;
struct xfs_dinode *dip;
if (error)
goto out_destroy;
- ip->i_fork_ops = ifork_ops;
-
if (!libxfs_inode_verify_forks(ip)) {
libxfs_irele(ip);
return -EFSCORRUPTED;
}
ASSERT(*ialloc_context == NULL);
- error = libxfs_iget(tp->t_mountp, tp, ino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = libxfs_iget(tp->t_mountp, tp, ino, 0, &ip);
if (error != 0)
return error;
ASSERT(ip != NULL);
ip->i_cnextents = 0;
}
-/* Default fork content verifiers. */
-struct xfs_ifork_ops xfs_default_ifork_ops = {
- .verify_attr = xfs_attr_shortform_verify,
- .verify_dir = xfs_dir2_sf_verify,
- .verify_symlink = xfs_symlink_shortform_verify,
-};
-
/* Verify the inline contents of the data fork of an inode. */
xfs_failaddr_t
xfs_ifork_verify_data(
- struct xfs_inode *ip,
- struct xfs_ifork_ops *ops)
+ struct xfs_inode *ip)
{
/* Non-local data fork, we're done. */
if (ip->i_d.di_format != XFS_DINODE_FMT_LOCAL)
/* Check the inline data fork if there is one. */
switch (VFS_I(ip)->i_mode & S_IFMT) {
case S_IFDIR:
- return ops->verify_dir(ip);
+ return xfs_dir2_sf_verify(ip);
case S_IFLNK:
- return ops->verify_symlink(ip);
+ return xfs_symlink_shortform_verify(ip);
default:
return NULL;
}
/* Verify the inline contents of the attr fork of an inode. */
xfs_failaddr_t
xfs_ifork_verify_attr(
- struct xfs_inode *ip,
- struct xfs_ifork_ops *ops)
+ struct xfs_inode *ip)
{
/* There has to be an attr fork allocated if aformat is local. */
if (ip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)
return NULL;
if (!XFS_IFORK_PTR(ip, XFS_ATTR_FORK))
return __this_address;
- return ops->verify_attr(ip);
+ return xfs_attr_shortform_verify(ip);
}
extern void xfs_ifork_init_cow(struct xfs_inode *ip);
-typedef xfs_failaddr_t (*xfs_ifork_verifier_t)(struct xfs_inode *);
-
-struct xfs_ifork_ops {
- xfs_ifork_verifier_t verify_symlink;
- xfs_ifork_verifier_t verify_dir;
- xfs_ifork_verifier_t verify_attr;
-};
-extern struct xfs_ifork_ops xfs_default_ifork_ops;
-
-xfs_failaddr_t xfs_ifork_verify_data(struct xfs_inode *ip,
- struct xfs_ifork_ops *ops);
-xfs_failaddr_t xfs_ifork_verify_attr(struct xfs_inode *ip,
- struct xfs_ifork_ops *ops);
+xfs_failaddr_t xfs_ifork_verify_data(struct xfs_inode *ip);
+xfs_failaddr_t xfs_ifork_verify_attr(struct xfs_inode *ip);
#endif /* __XFS_INODE_FORK_H__ */
if (i)
res_failed(i);
- error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip);
if (error) {
do_error(
_("couldn't iget realtime bitmap inode -- error - %d\n"),
if (error)
res_failed(error);
- error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip);
if (error) {
do_error(
_("couldn't iget realtime bitmap inode -- error - %d\n"),
if (error)
res_failed(error);
- error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip);
if (error) {
do_error(
_("couldn't iget realtime summary inode -- error - %d\n"),
if (i)
res_failed(i);
- error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip);
if (error) {
do_error(
_("couldn't iget realtime summary inode -- error - %d\n"),
if (i)
res_failed(i);
- error = -libxfs_iget(mp, tp, mp->m_sb.sb_rootino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, tp, mp->m_sb.sb_rootino, 0, &ip);
if (error) {
do_error(_("could not iget root inode -- error - %d\n"), error);
}
* would have been cleared in phase3 and phase4.
*/
- i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip,
- &xfs_default_ifork_ops);
+ i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip);
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
*/
-/* i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip,
- &xfs_default_ifork_ops);
+/* i = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip);
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,
- &xfs_default_ifork_ops);
+ err = -libxfs_iget(mp, NULL, orphanage_ino, 0, &orphanage_ip);
if (err)
do_error(_("%d - couldn't iget orphanage inode\n"), err);
/*
(unsigned long long)ino, ++incr);
/* Orphans may not have a proper parent, so use custom ops here */
- err = -libxfs_iget(mp, NULL, ino, 0, &ino_p, &xfs_default_ifork_ops);
+ err = -libxfs_iget(mp, NULL, ino, 0, &ino_p);
if (err)
do_error(_("%d - couldn't iget disconnected inode\n"), err);
ASSERT(!is_inode_refchecked(irec, ino_offset) || dotdot_update);
- error = -libxfs_iget(mp, NULL, ino, 0, &ip, &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, NULL, ino, 0, &ip);
if (error) {
if (!no_modify)
do_error(
error = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_remove, nres, 0, 0, &tp);
ASSERT(error == 0);
- error = -libxfs_iget(mp, tp, ino, 0, &ip, &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, tp, ino, 0, &ip);
if (error) {
if (!no_modify)
do_error(
ino == mp->m_sb.sb_pquotino)
return;
- error = -libxfs_iget(mp, NULL, ino, 0, &ip, &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, NULL, ino, 0, &ip);
if (error) {
do_warn(
_("could not open file %"PRIu64" for quotacheck, err=%d\n"),
if (!dquots || !chkd_flags)
return;
- error = -libxfs_iget(mp, NULL, ino, 0, &ip, &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, NULL, ino, 0, &ip);
if (error) {
do_warn(
_("could not open %s inode %"PRIu64" for quotacheck, err=%d\n"),
int error;
bool ret = false;
- error = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &ip,
- &xfs_default_ifork_ops);
+ error = -libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &ip);
if (error)
goto out;
if (!S_ISDIR(VFS_I(ip)->i_mode))