Skip to content

Commit

Permalink
lxc-ubuntu: update coding style
Browse files Browse the repository at this point in the history
Signed-off-by: José Martínez <xosemp@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
xose authored and stgraber committed Jul 7, 2014
1 parent b6e07af commit 5652d61
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions templates/lxc-ubuntu.in
Expand Up @@ -47,16 +47,19 @@ if [ -r /etc/default/lxc ]; then
fi

# Check if given path is in a btrfs partition
is_btrfs() {
is_btrfs()
{
[ -e $1 -a $(stat -f -c '%T' $1) = "btrfs" ]
}

# Check if given path is the root of a btrfs subvolume
is_btrfs_subvolume() {
is_btrfs_subvolume()
{
[ -d $1 -a $(stat -f -c '%T' $1) = "btrfs" -a $(stat -c '%i' $1) -eq 256 ]
}

try_mksubvolume() {
try_mksubvolume()
{
path=$1
[ -d $path ] && return 0
mkdir -p $(dirname $path)
Expand All @@ -67,7 +70,8 @@ try_mksubvolume() {
fi
}

try_rmsubvolume() {
try_rmsubvolume()
{
path=$1
[ -d $path ] || return 0
if is_btrfs_subvolume $path; then
Expand Down

0 comments on commit 5652d61

Please sign in to comment.