From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] readahead02: fix read_ahead_kb file not found
Date: Tue, 30 Aug 2016 14:21:20 +0200 [thread overview]
Message-ID: <20160830122119.GA23854@rei.lan> (raw)
In-Reply-To: <1472296459-31507-1-git-send-email-naresh.kamboju@linaro.org>
Hi!
> @@ -193,7 +193,7 @@ static long get_device_readahead(const char *fname)
> if (stat(fname, &st) == -1)
> tst_brkm(TBROK | TERRNO, cleanup, "stat");
> snprintf(buf, sizeof(buf), "/sys/dev/block/%d:%d/queue/read_ahead_kb",
> - major(st.st_dev), minor(st.st_dev));
> + major(st.st_dev), minor(st.st_dev) & ~31);
So we clear lower five bits of the minor number here. Why exactly that amount?
Shouldn't we just pass zero as a minor number there anyway?
> SAFE_FILE_SCANF(cleanup, buf, "%ld", &ra_kb);
>
> return ra_kb * 1024;
> --
> 1.9.1
>
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-08-30 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-27 11:14 [LTP] [PATCH] readahead02: fix read_ahead_kb file not found naresh.kamboju
2016-08-30 12:21 ` Cyril Hrubis [this message]
2016-08-31 9:14 ` Naresh Kamboju
-- strict thread matches above, loose matches on Subject: below --
2016-08-31 9:11 naresh.kamboju
2016-09-01 13:14 naresh.kamboju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160830122119.GA23854@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox