Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0497b345 authored by Jens Axboe's avatar Jens Axboe
Browse files

blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure



Define as 32, which is is what BDEVNAME_SIZE is/was as well. This keeps
the user interface the same and gets rid of the difference between
kernel and user api here.

Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent ef9e3fac
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -369,7 +369,8 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
	if (!buts->buf_size || !buts->buf_nr)
		return -EINVAL;

	strcpy(buts->name, name);
	strncpy(buts->name, name, BLKTRACE_BDEV_SIZE);
	buts->name[BLKTRACE_BDEV_SIZE - 1] = '\0';

	/*
	 * some device names have larger paths - convert the slashes
+3 −5
Original line number Diff line number Diff line
@@ -122,15 +122,13 @@ enum {
	Blktrace_stopped,
};

#define BLKTRACE_BDEV_SIZE	32

/*
 * User setup structure passed with BLKTRACESTART
 */
struct blk_user_trace_setup {
#ifdef __KERNEL__
	char name[BDEVNAME_SIZE];	/* output */
#else
	char name[32];			/* output */
#endif
	char name[BLKTRACE_BDEV_SIZE];	/* output */
	__u16 act_mask;			/* input */
	__u32 buf_size;			/* input */
	__u32 buf_nr;			/* input */