]> git.proxmox.com Git - mirror_lxc.git/commit
Split bdev into modules: lxczfs
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 29 Dec 2015 12:35:53 +0000 (13:35 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 12 Jan 2016 07:50:45 +0000 (08:50 +0100)
commit8907f44457d8adfb8c144e5a07b3b09186cffb59
treed474850712ac0cd0748dd53afa61854e4efb8f8b
parent4dbfaf3084456a8c373094f4eb708224dd739390
Split bdev into modules: lxczfs

The functions:

- zfs_clone();
- zfs_clonepaths();
- zfs_create();
- zfs_destroy();
- zfs_detect();
- zfs_list_entry();
- zfs_mount();
- zfs_umount();

move from bdev.c to lxczfs.{c,h}. All functions previously declared as static
become public.

Adapt Makefile.am to include lxczfs.{c,h}.

The structs:

- struct bdev; /* defined in bdev.h */
- struct bdev_specs; /* defined in lxccontainer.h */
- struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxczfs.h as the functions
associated with zfs need access to it.

Minor changes:

- Use exit(EXIT_FAILURE) instead of exit(1).
- Use brackets around else {} if the if {} did:
I.e. instead of:

if {
// do one;
// do two;
} else
// do three;

use:

if {
// do one;
// do two;
} else {
// do three;
}
- Instead of declaring char pointers and arrays on the same line, i.e.:

char arr[len], *p;

  do:

char arr[len];
char *p;

  which makes intentions a lot clearer.

- Since we require c99 anyway, use finer-grained scoping by declaring
  variables where they are needed instead of simply at the top.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/Makefile.am
src/lxc/bdev/bdev.c
src/lxc/bdev/lxczfs.c [new file with mode: 0644]
src/lxc/bdev/lxczfs.h [new file with mode: 0644]