xfs: get rid of the ip parameter to xchk_setup_*
Now that the scrub context stores a pointer to the file that was used to invoke the scrub call, the struct xfs_inode pointer that we passed to all the setup functions is no longer necessary. This is only ever used if the caller wants us to scrub the metadata of the open file. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
71bddbccab
commit
026f57ebe1
@ -21,10 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xchk_setup_ag_allocbt(
|
xchk_setup_ag_allocbt(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
return xchk_setup_ag_btree(sc, ip, false);
|
return xchk_setup_ag_btree(sc, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free space btree scrubber. */
|
/* Free space btree scrubber. */
|
||||||
|
@ -69,8 +69,7 @@ xchk_setup_xattr_buf(
|
|||||||
/* Set us up to scrub an inode's extended attributes. */
|
/* Set us up to scrub an inode's extended attributes. */
|
||||||
int
|
int
|
||||||
xchk_setup_xattr(
|
xchk_setup_xattr(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ xchk_setup_xattr(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return xchk_setup_inode_contents(sc, ip, 0);
|
return xchk_setup_inode_contents(sc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extended Attributes */
|
/* Extended Attributes */
|
||||||
|
@ -26,12 +26,11 @@
|
|||||||
/* Set us up with an inode's bmap. */
|
/* Set us up with an inode's bmap. */
|
||||||
int
|
int
|
||||||
xchk_setup_inode_bmap(
|
xchk_setup_inode_bmap(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = xchk_get_inode(sc, ip);
|
error = xchk_get_inode(sc);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -593,8 +593,7 @@ xchk_trans_alloc(
|
|||||||
/* Set us up with a transaction and an empty context. */
|
/* Set us up with a transaction and an empty context. */
|
||||||
int
|
int
|
||||||
xchk_setup_fs(
|
xchk_setup_fs(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
uint resblks;
|
uint resblks;
|
||||||
|
|
||||||
@ -606,7 +605,6 @@ xchk_setup_fs(
|
|||||||
int
|
int
|
||||||
xchk_setup_ag_btree(
|
xchk_setup_ag_btree(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc,
|
||||||
struct xfs_inode *ip,
|
|
||||||
bool force_log)
|
bool force_log)
|
||||||
{
|
{
|
||||||
struct xfs_mount *mp = sc->mp;
|
struct xfs_mount *mp = sc->mp;
|
||||||
@ -624,7 +622,7 @@ xchk_setup_ag_btree(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = xchk_setup_fs(sc, ip);
|
error = xchk_setup_fs(sc);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
@ -652,11 +650,11 @@ xchk_checkpoint_log(
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xchk_get_inode(
|
xchk_get_inode(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip_in)
|
|
||||||
{
|
{
|
||||||
struct xfs_imap imap;
|
struct xfs_imap imap;
|
||||||
struct xfs_mount *mp = sc->mp;
|
struct xfs_mount *mp = sc->mp;
|
||||||
|
struct xfs_inode *ip_in = XFS_I(file_inode(sc->file));
|
||||||
struct xfs_inode *ip = NULL;
|
struct xfs_inode *ip = NULL;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@ -717,12 +715,11 @@ xchk_get_inode(
|
|||||||
int
|
int
|
||||||
xchk_setup_inode_contents(
|
xchk_setup_inode_contents(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc,
|
||||||
struct xfs_inode *ip,
|
|
||||||
unsigned int resblks)
|
unsigned int resblks)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = xchk_get_inode(sc, ip);
|
error = xchk_get_inode(sc);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -72,48 +72,37 @@ bool xchk_should_check_xref(struct xfs_scrub *sc, int *error,
|
|||||||
struct xfs_btree_cur **curpp);
|
struct xfs_btree_cur **curpp);
|
||||||
|
|
||||||
/* Setup functions */
|
/* Setup functions */
|
||||||
int xchk_setup_fs(struct xfs_scrub *sc, struct xfs_inode *ip);
|
int xchk_setup_fs(struct xfs_scrub *sc);
|
||||||
int xchk_setup_ag_allocbt(struct xfs_scrub *sc,
|
int xchk_setup_ag_allocbt(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *ip);
|
int xchk_setup_ag_iallocbt(struct xfs_scrub *sc);
|
||||||
int xchk_setup_ag_iallocbt(struct xfs_scrub *sc,
|
int xchk_setup_ag_rmapbt(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *ip);
|
int xchk_setup_ag_refcountbt(struct xfs_scrub *sc);
|
||||||
int xchk_setup_ag_rmapbt(struct xfs_scrub *sc,
|
int xchk_setup_inode(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *ip);
|
int xchk_setup_inode_bmap(struct xfs_scrub *sc);
|
||||||
int xchk_setup_ag_refcountbt(struct xfs_scrub *sc,
|
int xchk_setup_inode_bmap_data(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *ip);
|
int xchk_setup_directory(struct xfs_scrub *sc);
|
||||||
int xchk_setup_inode(struct xfs_scrub *sc,
|
int xchk_setup_xattr(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *ip);
|
int xchk_setup_symlink(struct xfs_scrub *sc);
|
||||||
int xchk_setup_inode_bmap(struct xfs_scrub *sc,
|
int xchk_setup_parent(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *ip);
|
|
||||||
int xchk_setup_inode_bmap_data(struct xfs_scrub *sc,
|
|
||||||
struct xfs_inode *ip);
|
|
||||||
int xchk_setup_directory(struct xfs_scrub *sc,
|
|
||||||
struct xfs_inode *ip);
|
|
||||||
int xchk_setup_xattr(struct xfs_scrub *sc,
|
|
||||||
struct xfs_inode *ip);
|
|
||||||
int xchk_setup_symlink(struct xfs_scrub *sc,
|
|
||||||
struct xfs_inode *ip);
|
|
||||||
int xchk_setup_parent(struct xfs_scrub *sc,
|
|
||||||
struct xfs_inode *ip);
|
|
||||||
#ifdef CONFIG_XFS_RT
|
#ifdef CONFIG_XFS_RT
|
||||||
int xchk_setup_rt(struct xfs_scrub *sc, struct xfs_inode *ip);
|
int xchk_setup_rt(struct xfs_scrub *sc);
|
||||||
#else
|
#else
|
||||||
static inline int
|
static inline int
|
||||||
xchk_setup_rt(struct xfs_scrub *sc, struct xfs_inode *ip)
|
xchk_setup_rt(struct xfs_scrub *sc)
|
||||||
{
|
{
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_XFS_QUOTA
|
#ifdef CONFIG_XFS_QUOTA
|
||||||
int xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip);
|
int xchk_setup_quota(struct xfs_scrub *sc);
|
||||||
#else
|
#else
|
||||||
static inline int
|
static inline int
|
||||||
xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip)
|
xchk_setup_quota(struct xfs_scrub *sc)
|
||||||
{
|
{
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int xchk_setup_fscounters(struct xfs_scrub *sc, struct xfs_inode *ip);
|
int xchk_setup_fscounters(struct xfs_scrub *sc);
|
||||||
|
|
||||||
void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa);
|
void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa);
|
||||||
int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno,
|
int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno,
|
||||||
@ -126,11 +115,9 @@ void xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa);
|
|||||||
int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
|
int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
|
||||||
const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
|
const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
|
||||||
|
|
||||||
int xchk_setup_ag_btree(struct xfs_scrub *sc, struct xfs_inode *ip,
|
int xchk_setup_ag_btree(struct xfs_scrub *sc, bool force_log);
|
||||||
bool force_log);
|
int xchk_get_inode(struct xfs_scrub *sc);
|
||||||
int xchk_get_inode(struct xfs_scrub *sc, struct xfs_inode *ip_in);
|
int xchk_setup_inode_contents(struct xfs_scrub *sc, unsigned int resblks);
|
||||||
int xchk_setup_inode_contents(struct xfs_scrub *sc, struct xfs_inode *ip,
|
|
||||||
unsigned int resblks);
|
|
||||||
void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
|
void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -22,10 +22,9 @@
|
|||||||
/* Set us up to scrub directories. */
|
/* Set us up to scrub directories. */
|
||||||
int
|
int
|
||||||
xchk_setup_directory(
|
xchk_setup_directory(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
return xchk_setup_inode_contents(sc, ip, 0);
|
return xchk_setup_inode_contents(sc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Directories */
|
/* Directories */
|
||||||
|
@ -116,8 +116,7 @@ next_loop_perag:
|
|||||||
|
|
||||||
int
|
int
|
||||||
xchk_setup_fscounters(
|
xchk_setup_fscounters(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
struct xchk_fscounters *fsc;
|
struct xchk_fscounters *fsc;
|
||||||
int error;
|
int error;
|
||||||
|
@ -29,10 +29,9 @@
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xchk_setup_ag_iallocbt(
|
xchk_setup_ag_iallocbt(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
return xchk_setup_ag_btree(sc, ip, sc->flags & XCHK_TRY_HARDER);
|
return xchk_setup_ag_btree(sc, sc->flags & XCHK_TRY_HARDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inode btree scrubber. */
|
/* Inode btree scrubber. */
|
||||||
|
@ -28,8 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xchk_setup_inode(
|
xchk_setup_inode(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ xchk_setup_inode(
|
|||||||
* Try to get the inode. If the verifiers fail, we try again
|
* Try to get the inode. If the verifiers fail, we try again
|
||||||
* in raw mode.
|
* in raw mode.
|
||||||
*/
|
*/
|
||||||
error = xchk_get_inode(sc, ip);
|
error = xchk_get_inode(sc);
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
@ -20,10 +20,9 @@
|
|||||||
/* Set us up to scrub parents. */
|
/* Set us up to scrub parents. */
|
||||||
int
|
int
|
||||||
xchk_setup_parent(
|
xchk_setup_parent(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
return xchk_setup_inode_contents(sc, ip, 0);
|
return xchk_setup_inode_contents(sc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parent pointers */
|
/* Parent pointers */
|
||||||
|
@ -37,8 +37,7 @@ xchk_quota_to_dqtype(
|
|||||||
/* Set us up to scrub a quota. */
|
/* Set us up to scrub a quota. */
|
||||||
int
|
int
|
||||||
xchk_setup_quota(
|
xchk_setup_quota(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
xfs_dqtype_t dqtype;
|
xfs_dqtype_t dqtype;
|
||||||
int error;
|
int error;
|
||||||
@ -53,7 +52,7 @@ xchk_setup_quota(
|
|||||||
mutex_lock(&sc->mp->m_quotainfo->qi_quotaofflock);
|
mutex_lock(&sc->mp->m_quotainfo->qi_quotaofflock);
|
||||||
if (!xfs_this_quota_on(sc->mp, dqtype))
|
if (!xfs_this_quota_on(sc->mp, dqtype))
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
error = xchk_setup_fs(sc, ip);
|
error = xchk_setup_fs(sc);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
sc->ip = xfs_quota_inode(sc->mp, dqtype);
|
sc->ip = xfs_quota_inode(sc->mp, dqtype);
|
||||||
|
@ -19,10 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xchk_setup_ag_refcountbt(
|
xchk_setup_ag_refcountbt(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
return xchk_setup_ag_btree(sc, ip, false);
|
return xchk_setup_ag_btree(sc, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reference count btree scrubber. */
|
/* Reference count btree scrubber. */
|
||||||
|
@ -37,19 +37,18 @@
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xrep_attempt(
|
xrep_attempt(
|
||||||
struct xfs_inode *ip,
|
|
||||||
struct xfs_scrub *sc)
|
struct xfs_scrub *sc)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
trace_xrep_attempt(ip, sc->sm, error);
|
trace_xrep_attempt(XFS_I(file_inode(sc->file)), sc->sm, error);
|
||||||
|
|
||||||
xchk_ag_btcur_free(&sc->sa);
|
xchk_ag_btcur_free(&sc->sa);
|
||||||
|
|
||||||
/* Repair whatever's broken. */
|
/* Repair whatever's broken. */
|
||||||
ASSERT(sc->ops->repair);
|
ASSERT(sc->ops->repair);
|
||||||
error = sc->ops->repair(sc);
|
error = sc->ops->repair(sc);
|
||||||
trace_xrep_done(ip, sc->sm, error);
|
trace_xrep_done(XFS_I(file_inode(sc->file)), sc->sm, error);
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case 0:
|
case 0:
|
||||||
/*
|
/*
|
||||||
|
@ -17,7 +17,7 @@ static inline int xrep_notsupported(struct xfs_scrub *sc)
|
|||||||
|
|
||||||
/* Repair helpers */
|
/* Repair helpers */
|
||||||
|
|
||||||
int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc);
|
int xrep_attempt(struct xfs_scrub *sc);
|
||||||
void xrep_failure(struct xfs_mount *mp);
|
void xrep_failure(struct xfs_mount *mp);
|
||||||
int xrep_roll_ag_trans(struct xfs_scrub *sc);
|
int xrep_roll_ag_trans(struct xfs_scrub *sc);
|
||||||
bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
|
bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
|
||||||
@ -64,8 +64,8 @@ int xrep_agi(struct xfs_scrub *sc);
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static inline int xrep_attempt(
|
static inline int
|
||||||
struct xfs_inode *ip,
|
xrep_attempt(
|
||||||
struct xfs_scrub *sc)
|
struct xfs_scrub *sc)
|
||||||
{
|
{
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
@ -21,10 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xchk_setup_ag_rmapbt(
|
xchk_setup_ag_rmapbt(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
return xchk_setup_ag_btree(sc, ip, false);
|
return xchk_setup_ag_btree(sc, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reverse-mapping scrubber. */
|
/* Reverse-mapping scrubber. */
|
||||||
|
@ -20,12 +20,11 @@
|
|||||||
/* Set us up with the realtime metadata locked. */
|
/* Set us up with the realtime metadata locked. */
|
||||||
int
|
int
|
||||||
xchk_setup_rt(
|
xchk_setup_rt(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = xchk_setup_fs(sc, ip);
|
error = xchk_setup_fs(sc);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -468,8 +468,7 @@ xfs_scrub_metadata(
|
|||||||
.agno = NULLAGNUMBER,
|
.agno = NULLAGNUMBER,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
struct xfs_inode *ip = XFS_I(file_inode(file));
|
struct xfs_mount *mp = XFS_I(file_inode(file))->i_mount;
|
||||||
struct xfs_mount *mp = ip->i_mount;
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
sc.mp = mp;
|
sc.mp = mp;
|
||||||
@ -477,7 +476,7 @@ xfs_scrub_metadata(
|
|||||||
BUILD_BUG_ON(sizeof(meta_scrub_ops) !=
|
BUILD_BUG_ON(sizeof(meta_scrub_ops) !=
|
||||||
(sizeof(struct xchk_meta_ops) * XFS_SCRUB_TYPE_NR));
|
(sizeof(struct xchk_meta_ops) * XFS_SCRUB_TYPE_NR));
|
||||||
|
|
||||||
trace_xchk_start(ip, sm, error);
|
trace_xchk_start(XFS_I(file_inode(file)), sm, error);
|
||||||
|
|
||||||
/* Forbidden if we are shut down or mounted norecovery. */
|
/* Forbidden if we are shut down or mounted norecovery. */
|
||||||
error = -ESHUTDOWN;
|
error = -ESHUTDOWN;
|
||||||
@ -507,7 +506,7 @@ retry_op:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set up for the operation. */
|
/* Set up for the operation. */
|
||||||
error = sc.ops->setup(&sc, ip);
|
error = sc.ops->setup(&sc);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_teardown;
|
goto out_teardown;
|
||||||
|
|
||||||
@ -553,7 +552,7 @@ retry_op:
|
|||||||
* If it's broken, userspace wants us to fix it, and we haven't
|
* If it's broken, userspace wants us to fix it, and we haven't
|
||||||
* already tried to fix it, then attempt a repair.
|
* already tried to fix it, then attempt a repair.
|
||||||
*/
|
*/
|
||||||
error = xrep_attempt(ip, &sc);
|
error = xrep_attempt(&sc);
|
||||||
if (error == -EAGAIN) {
|
if (error == -EAGAIN) {
|
||||||
/*
|
/*
|
||||||
* Either the repair function succeeded or it couldn't
|
* Either the repair function succeeded or it couldn't
|
||||||
@ -574,7 +573,7 @@ out_nofix:
|
|||||||
out_teardown:
|
out_teardown:
|
||||||
error = xchk_teardown(&sc, error);
|
error = xchk_teardown(&sc, error);
|
||||||
out:
|
out:
|
||||||
trace_xchk_done(ip, sm, error);
|
trace_xchk_done(XFS_I(file_inode(file)), sm, error);
|
||||||
if (error == -EFSCORRUPTED || error == -EFSBADCRC) {
|
if (error == -EFSCORRUPTED || error == -EFSBADCRC) {
|
||||||
sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
|
sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
|
||||||
error = 0;
|
error = 0;
|
||||||
|
@ -18,8 +18,7 @@ enum xchk_type {
|
|||||||
|
|
||||||
struct xchk_meta_ops {
|
struct xchk_meta_ops {
|
||||||
/* Acquire whatever resources are needed for the operation. */
|
/* Acquire whatever resources are needed for the operation. */
|
||||||
int (*setup)(struct xfs_scrub *,
|
int (*setup)(struct xfs_scrub *sc);
|
||||||
struct xfs_inode *);
|
|
||||||
|
|
||||||
/* Examine metadata for errors. */
|
/* Examine metadata for errors. */
|
||||||
int (*scrub)(struct xfs_scrub *);
|
int (*scrub)(struct xfs_scrub *);
|
||||||
|
@ -18,15 +18,14 @@
|
|||||||
/* Set us up to scrub a symbolic link. */
|
/* Set us up to scrub a symbolic link. */
|
||||||
int
|
int
|
||||||
xchk_setup_symlink(
|
xchk_setup_symlink(
|
||||||
struct xfs_scrub *sc,
|
struct xfs_scrub *sc)
|
||||||
struct xfs_inode *ip)
|
|
||||||
{
|
{
|
||||||
/* Allocate the buffer without the inode lock held. */
|
/* Allocate the buffer without the inode lock held. */
|
||||||
sc->buf = kvzalloc(XFS_SYMLINK_MAXLEN + 1, GFP_KERNEL);
|
sc->buf = kvzalloc(XFS_SYMLINK_MAXLEN + 1, GFP_KERNEL);
|
||||||
if (!sc->buf)
|
if (!sc->buf)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
return xchk_setup_inode_contents(sc, ip, 0);
|
return xchk_setup_inode_contents(sc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Symbolic links. */
|
/* Symbolic links. */
|
||||||
|
Loading…
Reference in New Issue
Block a user