These parameters will be needed for a number of reasons
after init/load.
The params struct contains the uuid, so the explicit uuid
member in spdk_reduce_vol is no longer needed.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ide12a7816e4a236be5c73a5733e76919ad9af103
Reviewed-on: https://review.gerrithub.io/433512
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
A pm file consists of:
* volume metadata
* logical map
* chunk maps
Define all three of these in struct spdk_reduce_vol.
Also define -1ULL to denote an empty entry in the logical
map or a chunk map - and initialize the logical map
and chunk maps entirely with this value when initializing
a new compressed volume.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9aae23c73d2fbbdc72050ab103fe9e686907eb40
Reviewed-on: https://review.gerrithub.io/433490
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
We will need the extra iov in the upcoming load path,
so we can load the superblock and pmem file path into
separate buffers.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99cce0172bd772ca93813a002dcce6943e661f35
Reviewed-on: https://review.gerrithub.io/433087
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Currently the API requires the caller to open the
pmem file and pass the mapped buffer pointer, length
and pmem flag to libreduce using the spdk_reduce_pm_file
structure.
Let's have the library just do the pmem_map_file() instead.
Users then just pass the path to create the pmem file. The
library will still use the spdk_reduce_pm_file structure
internally - so move its definition out of the public header
and into reduce.c.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I81fcbfdfbb3211dca016d6aa422cf2e1ab16d84d
Reviewed-on: https://review.gerrithub.io/432593
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Write pm filepath first to offset 4K. Then write
the super block to offset 0. This ensures the backing
device isn't really valid until both are written
(avoiding the case where the super block got written
but not the path.)
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I55508aa67b4179e658827c982cd955d009a3f321
Reviewed-on: https://review.gerrithub.io/432505
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <spdk-ci.pdl@broadcom.com>
While here, add basic implementations for these function ptrs
in the unit tests.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I54e18a3b331777602fed29382b95b449005efcce
Reviewed-on: https://review.gerrithub.io/432503
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Add the following to struct spdk_reduce_pm_file:
* path of the pm file
* pointer to the mmapped pm region
* whether the mmaped address is pmem or not
Now use pmem_persist or pmem_msync to persist volume
parameters. Note that we do *not* persist the pm filename
to the pm file - the pm filename will be written to the
backing disk in a later patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1d873ae086dc20600798a49b98e1bf490ac750f3
Reviewed-on: https://review.gerrithub.io/430648
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
--with-reduce required to build reduce. This depends on
libpmem being installed.
We still need to work out details in pkgdep.sh and
vm_setup.sh. Some distributions like Ubuntu still
require configuring extra package repositories to
get libpmem packages.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4e056ce1da9a1fecb4458f8f5e7ff5d61c422533
Reviewed-on: https://review.gerrithub.io/430646
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
A compressed volume will require both a persistent
memory region/file for per-chunk metadata and a
backing device to store the compressed blocks.
Add functions here to calculate the sizes of these
based on the desired size of the compressed volume,
its chunk size and the size of each backing block.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9203479e2a268c3ab0e2b0e06e348285e9d1cd13
Reviewed-on: https://review.gerrithub.io/430387
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
reduce will be a block compression algorithm designed
specifically for SPDK. It is called "reduce" because
it reduces the data size on disk.
This patch just adds the shell of a library, include
files and unit tests. This will be fleshed out in
the rest of the patches in this series.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I88e238af64142a7c0e50ab7b447280026b55581f
Reviewed-on: https://review.gerrithub.io/430386
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>