Skip to content

Commit

Permalink
xfs: constify the buffer pointer arguments to error functions
Browse files Browse the repository at this point in the history
Some of the xfs error message functions take a pointer to a buffer that
will be dumped to the system log.  The logging functions don't change
the contents, so constify all the parameters.  This enables the next
patch to ensure that we log bad metadata when we encounter it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Darrick J. Wong committed Nov 4, 2019
1 parent e91ec88 commit d243b89
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions fs/xfs/xfs_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ xfs_corruption_error(
const char *tag,
int level,
struct xfs_mount *mp,
void *buf,
const void *buf,
size_t bufsize,
const char *filename,
int linenum,
Expand All @@ -350,7 +350,7 @@ xfs_buf_verifier_error(
struct xfs_buf *bp,
int error,
const char *name,
void *buf,
const void *buf,
size_t bufsz,
xfs_failaddr_t failaddr)
{
Expand Down Expand Up @@ -402,7 +402,7 @@ xfs_inode_verifier_error(
struct xfs_inode *ip,
int error,
const char *name,
void *buf,
const void *buf,
size_t bufsz,
xfs_failaddr_t failaddr)
{
Expand Down
6 changes: 3 additions & 3 deletions fs/xfs/xfs_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp,
const char *filename, int linenum,
xfs_failaddr_t failaddr);
extern void xfs_corruption_error(const char *tag, int level,
struct xfs_mount *mp, void *buf, size_t bufsize,
struct xfs_mount *mp, const void *buf, size_t bufsize,
const char *filename, int linenum,
xfs_failaddr_t failaddr);
extern void xfs_buf_verifier_error(struct xfs_buf *bp, int error,
const char *name, void *buf, size_t bufsz,
const char *name, const void *buf, size_t bufsz,
xfs_failaddr_t failaddr);
extern void xfs_verifier_error(struct xfs_buf *bp, int error,
xfs_failaddr_t failaddr);
extern void xfs_inode_verifier_error(struct xfs_inode *ip, int error,
const char *name, void *buf, size_t bufsz,
const char *name, const void *buf, size_t bufsz,
xfs_failaddr_t failaddr);

#define XFS_ERROR_REPORT(e, lvl, mp) \
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ assfail(char *expr, char *file, int line)
}

void
xfs_hex_dump(void *p, int length)
xfs_hex_dump(const void *p, int length)
{
print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_OFFSET, 16, 1, p, length, 1);
}
2 changes: 1 addition & 1 deletion fs/xfs/xfs_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ do { \
extern void assfail(char *expr, char *f, int l);
extern void asswarn(char *expr, char *f, int l);

extern void xfs_hex_dump(void *p, int length);
extern void xfs_hex_dump(const void *p, int length);

#endif /* __XFS_MESSAGE_H */

0 comments on commit d243b89

Please sign in to comment.