From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2] controllers/cgroup_fj: fix and clean up
Date: Thu, 5 Nov 2015 15:02:42 +0100 [thread overview]
Message-ID: <20151105140242.GC7226@rei> (raw)
In-Reply-To: <1446458018-20866-1-git-send-email-chnyda@suse.com>
Hi!
> +mounted=1;
>
> expected=1;
>
> @@ -132,6 +133,12 @@ if [ "$#" -ne "9" ]; then
> exit -1;
> fi
>
> +mount_point=$(get_mount_point)
> +if [ "$mount_point" == "" ] ; then
> + mounted=0
> + mount_point=/dev/cgroup
> +fi
> +
> check_para;
> if [ $? -ne 0 ]; then
> usage;
> @@ -139,7 +146,9 @@ if [ $? -ne 0 ]; then
> fi
> setup;
>
> -mount_cgroup;
> +if [ $mounted -ne 1 ]; then
> + mount_cgroup;
> +fi
It would be more elegant if this snippets of code that detect if cgroup
is mounted and mount it if it isn't were part of the setup() function
instead of being copied in each test.
...
> +get_mount_point()
> +{
> + check_point=`grep -w $subsystem /proc/mounts | cut -f 2 | cut -d " " -f2`
I would do even more specific:
grep -w "^$subsystem"
which would match only lines that begin with word "$subsystem".
Otherwise this looks good.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2015-11-05 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 9:53 [LTP] [PATCH V2] controllers/cgroup_fj: fix and clean up Cedric Hnyda
2015-11-05 14:02 ` Cyril Hrubis [this message]
2015-11-05 15:16 ` Cedric Hnyda
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=20151105140242.GC7226@rei \
--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