]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: remove xfs_errortag_get
authorChristoph Hellwig <hch@lst.de>
Thu, 18 Sep 2025 14:34:33 +0000 (07:34 -0700)
committerCarlos Maiolino <cem@kernel.org>
Thu, 18 Sep 2025 15:32:02 +0000 (17:32 +0200)
xfs_errortag_get is only called by xfs_errortag_attr_show, which does not
need to validate the error tag, because it can only be called on valid
error tags that had a sysfs attribute registered.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_error.c
fs/xfs/xfs_error.h

index dbd87e1376943a90db9b304009b2e137bbe2053b..45a43e47ce926a5992bcc5ffc0593b100825d380 100644 (file)
@@ -118,10 +118,9 @@ xfs_errortag_attr_show(
        char                    *buf)
 {
        struct xfs_mount        *mp = to_mp(kobject);
-       struct xfs_errortag_attr *xfs_attr = to_attr(attr);
+       unsigned int            error_tag = to_attr(attr)->tag;
 
-       return snprintf(buf, PAGE_SIZE, "%u\n",
-                       xfs_errortag_get(mp, xfs_attr->tag));
+       return snprintf(buf, PAGE_SIZE, "%u\n", mp->m_errortag[error_tag]);
 }
 
 static const struct sysfs_ops xfs_errortag_sysfs_ops = {
@@ -326,17 +325,6 @@ xfs_errortag_test(
        return true;
 }
 
-int
-xfs_errortag_get(
-       struct xfs_mount        *mp,
-       unsigned int            error_tag)
-{
-       if (!xfs_errortag_valid(error_tag))
-               return -EINVAL;
-
-       return mp->m_errortag[error_tag];
-}
-
 int
 xfs_errortag_set(
        struct xfs_mount        *mp,
index 0b9c5ba8a5981a5d499d8129cbbfd378906e4a9b..3aeb03001acfcc2fd4a48da39343f2ef966b6b19 100644 (file)
@@ -58,7 +58,6 @@ bool xfs_errortag_enabled(struct xfs_mount *mp, unsigned int tag);
                mdelay((mp)->m_errortag[(tag)]); \
        } while (0)
 
-extern int xfs_errortag_get(struct xfs_mount *mp, unsigned int error_tag);
 extern int xfs_errortag_set(struct xfs_mount *mp, unsigned int error_tag,
                unsigned int tag_value);
 extern int xfs_errortag_add(struct xfs_mount *mp, unsigned int error_tag);