forked from ceph/ceph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: extract backend driver from bluestore to access device
1. Both bluestore or other component e.g. rbd could use the same driver to access storage device. It's better to use one library to integrate the driver. 2. os and crimson-alienstore are static libraries. Link blk library into them. Main changes are below: 1. move backend driver into src/blk src/$ mkdir -p blk/{aio,kernel,spdk,pmem,zns} src/$ mv os/bluestore/{BlockDevice.h,BlockDevice.cc} blk src/$ mv os/bluestore/{ceph_aio.h} aio/aio.h src/$ mv os/bluestore/{aio.cc} aio/ src/$ mv os/bluestore/{KernelDevice.h,KernelDevice.cc} kernel/ src/$ mv os/bluestore/{ceph_io_uring.h} kernel/io_uring.h src/$ mv os/bluestore/{io_uring.cc} kernel_drv/ src/$ mv os/bluestore/{NVMEDevice.h,NVMEDevice.cc} spdk/ src/$ mv os/bluestore/{PMEMDevice.h,PMEMDevice.cc} pmem/ src/$ mv os/bluestore/{HMSMRDevice.h,HMSMRDevice.cc} zns/ 2. customize macro name in header file to remove bluestore specific text 3. adjust header file patch in source code 4. create cmake rule blk/CMakeLists.txt to build blk 5. modify src/CMakeLists.txt to integrate blk 6. modify other CMakeLists.txt to adapt to new file structure. Signed-off-by: Changcheng Liu <[email protected]> Co-authored-by: Kefu Chai <[email protected]>
- Loading branch information
1 parent
b63ae14
commit b734735
Showing
23 changed files
with
92 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -544,6 +544,7 @@ endif() | |
|
||
add_subdirectory(kv) | ||
add_subdirectory(os) | ||
add_subdirectory(blk) | ||
|
||
add_subdirectory(osd) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
if(WITH_BLUESTORE OR WITH_RBD_RWL) | ||
list(APPEND libblk_srcs | ||
BlockDevice.cc) | ||
endif() | ||
|
||
if(HAVE_LIBAIO OR HAVE_POSIXAIO) | ||
list(APPEND libblk_srcs | ||
kernel/KernelDevice.cc | ||
kernel/io_uring.cc | ||
aio/aio.cc) | ||
endif() | ||
|
||
if(WITH_BLUESTORE_PMEM) | ||
list(APPEND libblk_srcs | ||
pmem/PMEMDevice.cc) | ||
endif() | ||
|
||
if(WITH_SPDK) | ||
list(APPEND libblk_srcs | ||
spdk/NVMEDevice.cc) | ||
endif() | ||
|
||
if(HAVE_LIBZBC) | ||
list(APPEND libblk_srcs | ||
zns/HMSMRDevice.cc) | ||
endif() | ||
|
||
add_library(blk ${libblk_srcs}) | ||
target_include_directories(blk PRIVATE "./") | ||
|
||
if(HAVE_LIBAIO) | ||
target_link_libraries(blk PUBLIC ${AIO_LIBRARIES}) | ||
endif(HAVE_LIBAIO) | ||
|
||
if(WITH_SPDK) | ||
target_link_libraries(blk PRIVATE ${SPDK_LIBRARIES}) | ||
endif() | ||
|
||
if(HAVE_LIBZBC) | ||
target_link_libraries(blk ${ZBC_LIBRARIES}) | ||
endif() | ||
|
||
if(WITH_BLUESTORE_PMEM OR WITH_RBD_RWL) | ||
target_link_libraries(blk | ||
PUBLIC pmem::pmemobj | ||
PRIVATE pmem::pmem) | ||
endif() | ||
|
||
if(WITH_EVENTTRACE) | ||
add_dependencies(blk eventtrace_tp) | ||
endif() | ||
|
||
if(WITH_LIBURING) | ||
if(WITH_SYSTEM_LIBURING) | ||
find_package(uring REQUIRED) | ||
else() | ||
include(Builduring) | ||
build_uring() | ||
endif() | ||
target_link_libraries(blk PRIVATE uring::uring) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.