diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-12-20 14:09:45 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-12-20 14:09:45 +0100 |
commit | 8cbd01ba9c38eb16f3a572300da486ac544519b7 (patch) | |
tree | e9a800bcb96bf8e937ddf0d420514dccbc6c1a75 /fs/xfs/scrub/metapath.c | |
parent | 66a0a2b0473c39ae85c44628d14e4366fdc0aa0d (diff) | |
parent | 32c9c06adb5b157ef259233775a063a43746d699 (diff) | |
download | linux-8cbd01ba9c38eb16f3a572300da486ac544519b7.tar.gz linux-8cbd01ba9c38eb16f3a572300da486ac544519b7.tar.bz2 linux-8cbd01ba9c38eb16f3a572300da486ac544519b7.zip |
Merge tag 'asoc-fix-v6.13-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.13
A mix of quirks and small fixes, nothing too major anywhere.
Diffstat (limited to 'fs/xfs/scrub/metapath.c')
-rw-r--r-- | fs/xfs/scrub/metapath.c | 68 |
1 files changed, 26 insertions, 42 deletions
diff --git a/fs/xfs/scrub/metapath.c b/fs/xfs/scrub/metapath.c index b78db6513465..c678cba1ffc3 100644 --- a/fs/xfs/scrub/metapath.c +++ b/fs/xfs/scrub/metapath.c @@ -171,23 +171,13 @@ static int xchk_setup_metapath_quotadir( struct xfs_scrub *sc) { - struct xfs_trans *tp; - struct xfs_inode *dp = NULL; - int error; - - error = xfs_trans_alloc_empty(sc->mp, &tp); - if (error) - return error; + struct xfs_quotainfo *qi = sc->mp->m_quotainfo; - error = xfs_dqinode_load_parent(tp, &dp); - xfs_trans_cancel(tp); - if (error) - return error; + if (!qi || !qi->qi_dirip) + return -ENOENT; - error = xchk_setup_metapath_scan(sc, sc->mp->m_metadirip, - kasprintf(GFP_KERNEL, "quota"), dp); - xfs_irele(dp); - return error; + return xchk_setup_metapath_scan(sc, sc->mp->m_metadirip, + kstrdup("quota", GFP_KERNEL), qi->qi_dirip); } /* Scan a quota inode under the /quota directory. */ @@ -196,37 +186,31 @@ xchk_setup_metapath_dqinode( struct xfs_scrub *sc, xfs_dqtype_t type) { - struct xfs_trans *tp = NULL; - struct xfs_inode *dp = NULL; + struct xfs_quotainfo *qi = sc->mp->m_quotainfo; struct xfs_inode *ip = NULL; - const char *path; - int error; - - error = xfs_trans_alloc_empty(sc->mp, &tp); - if (error) - return error; - error = xfs_dqinode_load_parent(tp, &dp); - if (error) - goto out_cancel; - - error = xfs_dqinode_load(tp, dp, type, &ip); - if (error) - goto out_dp; - - xfs_trans_cancel(tp); - tp = NULL; + if (!qi) + return -ENOENT; - path = kasprintf(GFP_KERNEL, "%s", xfs_dqinode_path(type)); - error = xchk_setup_metapath_scan(sc, dp, path, ip); + switch (type) { + case XFS_DQTYPE_USER: + ip = qi->qi_uquotaip; + break; + case XFS_DQTYPE_GROUP: + ip = qi->qi_gquotaip; + break; + case XFS_DQTYPE_PROJ: + ip = qi->qi_pquotaip; + break; + default: + ASSERT(0); + return -EINVAL; + } + if (!ip) + return -ENOENT; - xfs_irele(ip); -out_dp: - xfs_irele(dp); -out_cancel: - if (tp) - xfs_trans_cancel(tp); - return error; + return xchk_setup_metapath_scan(sc, qi->qi_dirip, + kstrdup(xfs_dqinode_path(type), GFP_KERNEL), ip); } #else # define xchk_setup_metapath_quotadir(...) (-ENOENT) |