Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Commit

Permalink
add dax support
Browse files Browse the repository at this point in the history
Signed-off-by: Lai Jiangshan <[email protected]>
  • Loading branch information
laijs committed May 22, 2017
1 parent faef420 commit ac9f90a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
29 changes: 22 additions & 7 deletions build/kernel_config
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,17 @@ CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MOVABLE_NODE is not set
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_HAVE_BOOTMEM_INFO_NODE=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
# CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set
# CONFIG_MEMORY_HOTREMOVE is not set
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
CONFIG_MEMORY_BALLOON=y
Expand All @@ -496,6 +497,7 @@ CONFIG_GENERIC_EARLY_IOREMAP=y
CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ZONE_DEVICE=y
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
# CONFIG_X86_PMEM_LEGACY is not set
Expand Down Expand Up @@ -585,7 +587,7 @@ CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
# CONFIG_ACPI_NFIT is not set
CONFIG_ACPI_NFIT=y
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
# CONFIG_ACPI_APEI is not set
Expand Down Expand Up @@ -1359,6 +1361,7 @@ CONFIG_BLK_DEV_LOOP_MIN_COUNT=0
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=16384
# CONFIG_BLK_DEV_RAM_DAX is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_XEN_BLKDEV_FRONTEND=y
Expand Down Expand Up @@ -2072,8 +2075,18 @@ CONFIG_ARM_GIC_MAX_NR=1
# Android
#
# CONFIG_ANDROID is not set
# CONFIG_LIBNVDIMM is not set
# CONFIG_DEV_DAX is not set
CONFIG_LIBNVDIMM=y
CONFIG_BLK_DEV_PMEM=y
CONFIG_ND_BLK=y
CONFIG_ND_CLAIM=y
CONFIG_ND_BTT=y
CONFIG_BTT=y
CONFIG_ND_PFN=y
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
CONFIG_DEV_DAX=y
CONFIG_DEV_DAX_PMEM=y
CONFIG_NR_DEV_DAX=32768
# CONFIG_NVMEM is not set
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set
Expand Down Expand Up @@ -2125,7 +2138,7 @@ CONFIG_XFS_POSIX_ACL=y
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_FS_DAX is not set
CONFIG_FS_DAX=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
# CONFIG_EXPORTFS_BLOCK_OPS is not set
Expand Down Expand Up @@ -2294,6 +2307,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_HAVE_ARCH_KASAN=y
# CONFIG_KASAN is not set
CONFIG_ARCH_HAS_KCOV=y
# CONFIG_KCOV is not set

Expand Down
7 changes: 5 additions & 2 deletions src/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static int hyper_setup_container_rootfs(void *data)

if (container->fstype) {
char dev[128];
char *options = NULL;
char options[128];

if (container->scsiaddr) {
free(container->image);
Expand All @@ -585,8 +585,11 @@ static int hyper_setup_container_rootfs(void *data)
sprintf(dev, "/dev/%s", container->image);
fprintf(stdout, "device %s\n", dev);

memset(options, 0, sizeof(options));
if (strncmp(container->image, "pmem", 4) == 0)
strcat(options, ",dax");
if (!strncmp(container->fstype, "xfs", strlen("xfs")))
options = "nouuid";
strcat(options, ",nouuid");

if (hyper_mount_blockdev(dev, root, container->fstype, options) < 0) {
perror("mount device failed");
Expand Down

0 comments on commit ac9f90a

Please sign in to comment.