[lxc-devel] [lxc/lxc] 38683d: Split bdev into modules: overlay

GitHub noreply at github.com
Mon Dec 21 03:28:47 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 38683db41204cb221892beeb88d67a1df4a07287
      https://github.com/lxc/lxc/commit/38683db41204cb221892beeb88d67a1df4a07287
  Author: Christian Brauner <christian.brauner at mailbox.org>
  Date:   2015-12-15 (Tue, 15 Dec 2015)

  Changed paths:
    M src/lxc/Makefile.am
    R src/lxc/bdev.c
    R src/lxc/bdev.h
    A src/lxc/bdev/bdev.c
    A src/lxc/bdev/bdev.h
    A src/lxc/bdev/lxc-btrfs.h
    A src/lxc/bdev/overlay.c
    A src/lxc/bdev/overlay.h
    R src/lxc/lxc-btrfs.h
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  Split bdev into modules: overlay

With this commit we start to split bdev.{c,h} into modules located in the
subfolder bdev. We start by creating a module for overlay: overlay.{c,h}.

- The functions:

	- overlayfs_detect()
	- overlayfs_mount()
	- overlayfs_umount()
	- overlayfs_clonepaths()
	- overlayfs_destroy()
	- overlayfs_create()

  move from bdev.{c,h} to overlay.{c,h}. The only thing that remains in bdev.c
  is the static definition of

	- static const struct bdev_ops overlayfs_ops

- The functions:

	- update_ovl_paths()
	- overlay_getlower()

  move from lxccontainer.c to overlay.{c,h}. update_ovl_paths() is used to
  update absolute paths for overlay lxc.mount.entry entries but it seems to fit
  more here than into lxccontainer.c.
  The Function overlay_getlower() is used to extract the lower directory for
  overlay (and aufs) rootfs. It should at some point become a common helper.

- The functions:

	- do_rsync()
	- dir_new_path()

   remain in bdev.c for now but become extern. We declare them extern in
   overlay.c to be able to call them. As the comment to them correctly notices,
   they should at some point become common helpers and probably move to
   utils.{c,h} or some other more appropriate place.

- 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 in overlay.h so that the
  functions have access to it.

- The header overlay.h is *not* included in bdev.h but only in bdev.c so that
  when bdev.h is included the public functions in overlay.h cannot be accessed,
  i.e. if an implementation wants to call functions from overlay.h they need to
  explicitly include it. (As is e.g. done in the case of lxccontainer.c.)

- The header

	- lxc-btrfs.h

  also moves to the bdev subfolder.

- Adapt Makefile.am to the new bdev layout.

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>


  Commit: 4ec31c52242ebeacf67a0291c4f100e2b4a8c343
      https://github.com/lxc/lxc/commit/4ec31c52242ebeacf67a0291c4f100e2b4a8c343
  Author: Christian Brauner <christian.brauner at mailbox.org>
  Date:   2015-12-15 (Tue, 15 Dec 2015)

  Changed paths:
    M src/lxc/cgfs.c
    M src/lxc/cgmanager.c
    M src/lxc/conf.c
    M src/lxc/criu.c
    M src/lxc/lxc_copy.c
    M src/lxc/lxc_create.c
    M src/lxc/lxc_snapshot.c
    M src/lxc/start.c

  Log Message:
  -----------
  Adapt #includes for bdev.h to bdev/bdev.h

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>


  Commit: 83e79752a2cf2b25fc94acabd465227f0404571d
      https://github.com/lxc/lxc/commit/83e79752a2cf2b25fc94acabd465227f0404571d
  Author: Christian Brauner <christian.brauner at mailbox.org>
  Date:   2015-12-15 (Tue, 15 Dec 2015)

  Changed paths:
    M src/lxc/bdev/bdev.c
    M src/lxc/bdev/overlay.c
    M src/lxc/bdev/overlay.h
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  Unify naming for overlay types & functions

Use ovl_ as prefix for types and functions.

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>


  Commit: 5c484f794d472a1226688e9cd94aedc6077b95d1
      https://github.com/lxc/lxc/commit/5c484f794d472a1226688e9cd94aedc6077b95d1
  Author: Christian Brauner <christian.brauner at mailbox.org>
  Date:   2015-12-15 (Tue, 15 Dec 2015)

  Changed paths:
    M src/lxc/bdev/overlay.c
    M src/lxc/bdev/overlay.h
    M src/lxc/conf.c

  Log Message:
  -----------
  Move remaining overlay helpers to overlay.{c,h}

Move
	- ovl_get_rootfs_dir()
	- mount_entry_create_overlay_dirs()

from conf.h to overlay.{c,h} where they belong.

Rename
	- mount_entry_create_overlay_dirs() --> ovl_mkdir()

in accordance with the ovl_ prefix naming scheme for types and functions
associated with overlay.

Take the chance to add whitespace between operators where missing.

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>


  Commit: a14bf84f75a75b236d199f6a283e371200634396
      https://github.com/lxc/lxc/commit/a14bf84f75a75b236d199f6a283e371200634396
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2015-12-20 (Sun, 20 Dec 2015)

  Changed paths:
    M src/lxc/Makefile.am
    R src/lxc/bdev.c
    R src/lxc/bdev.h
    A src/lxc/bdev/bdev.c
    A src/lxc/bdev/bdev.h
    A src/lxc/bdev/lxc-btrfs.h
    A src/lxc/bdev/overlay.c
    A src/lxc/bdev/overlay.h
    M src/lxc/cgfs.c
    M src/lxc/cgmanager.c
    M src/lxc/conf.c
    M src/lxc/criu.c
    R src/lxc/lxc-btrfs.h
    M src/lxc/lxc_copy.c
    M src/lxc/lxc_create.c
    M src/lxc/lxc_snapshot.c
    M src/lxc/lxccontainer.c
    M src/lxc/start.c

  Log Message:
  -----------
  Merge pull request #724 from brauner/2015-12-12/split_bdev_into_modules

split bdev into modules


Compare: https://github.com/lxc/lxc/compare/fbc617e84be8...a14bf84f75a7


More information about the lxc-devel mailing list