Skip to content

Commit d5409eb

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: remove xfs_errortag_get
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>
1 parent 42c2183 commit d5409eb

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

fs/xfs/xfs_error.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ xfs_errortag_attr_show(
118118
char *buf)
119119
{
120120
struct xfs_mount *mp = to_mp(kobject);
121-
struct xfs_errortag_attr *xfs_attr = to_attr(attr);
121+
unsigned int error_tag = to_attr(attr)->tag;
122122

123-
return snprintf(buf, PAGE_SIZE, "%u\n",
124-
xfs_errortag_get(mp, xfs_attr->tag));
123+
return snprintf(buf, PAGE_SIZE, "%u\n", mp->m_errortag[error_tag]);
125124
}
126125

127126
static const struct sysfs_ops xfs_errortag_sysfs_ops = {
@@ -326,17 +325,6 @@ xfs_errortag_test(
326325
return true;
327326
}
328327

329-
int
330-
xfs_errortag_get(
331-
struct xfs_mount *mp,
332-
unsigned int error_tag)
333-
{
334-
if (!xfs_errortag_valid(error_tag))
335-
return -EINVAL;
336-
337-
return mp->m_errortag[error_tag];
338-
}
339-
340328
int
341329
xfs_errortag_set(
342330
struct xfs_mount *mp,

fs/xfs/xfs_error.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ bool xfs_errortag_enabled(struct xfs_mount *mp, unsigned int tag);
5858
mdelay((mp)->m_errortag[(tag)]); \
5959
} while (0)
6060

61-
extern int xfs_errortag_get(struct xfs_mount *mp, unsigned int error_tag);
6261
extern int xfs_errortag_set(struct xfs_mount *mp, unsigned int error_tag,
6362
unsigned int tag_value);
6463
extern int xfs_errortag_add(struct xfs_mount *mp, unsigned int error_tag);

0 commit comments

Comments
 (0)