Rename and move fd related helper functions to fd.c.
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ieccdd778348e8709ca4ef6cdf4f58f40021638db
This commit is contained in:
parent
1a9974ed1d
commit
edbed73064
@ -42,7 +42,6 @@
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_lcore.h>
|
||||
|
||||
#include "spdk/file.h"
|
||||
#include "spdk/nvme.h"
|
||||
#include "spdk/pci.h"
|
||||
#include "spdk/string.h"
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_lcore.h>
|
||||
|
||||
#include "spdk/file.h"
|
||||
#include "spdk/fd.h"
|
||||
#include "spdk/nvme.h"
|
||||
#include "spdk/pci.h"
|
||||
#include "spdk/string.h"
|
||||
@ -310,14 +310,14 @@ register_aio_file(const char *path)
|
||||
return -1;
|
||||
}
|
||||
|
||||
size = spdk_file_get_size(fd);
|
||||
size = spdk_fd_get_size(fd);
|
||||
if (size == 0) {
|
||||
fprintf(stderr, "Could not determine size of AIO device %s\n", path);
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
blklen = spdk_dev_get_blocklen(fd);
|
||||
blklen = spdk_fd_get_blocklen(fd);
|
||||
if (blklen == 0) {
|
||||
fprintf(stderr, "Could not determine block size of AIO device %s\n", path);
|
||||
close(fd);
|
||||
|
@ -35,8 +35,8 @@
|
||||
* OS filesystem utility functions
|
||||
*/
|
||||
|
||||
#ifndef SPDK_FILE_H
|
||||
#define SPDK_FILE_H
|
||||
#ifndef SPDK_FD_H
|
||||
#define SPDK_FD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -44,8 +44,8 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint64_t spdk_file_get_size(int fd);
|
||||
uint32_t spdk_dev_get_blocklen(int fd);
|
||||
uint64_t spdk_fd_get_size(int fd);
|
||||
uint32_t spdk_fd_get_blocklen(int fd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
@ -43,7 +43,7 @@
|
||||
|
||||
#include "spdk/bdev.h"
|
||||
#include "spdk/conf.h"
|
||||
#include "spdk/file.h"
|
||||
#include "spdk/fd.h"
|
||||
#include "spdk/log.h"
|
||||
|
||||
static int g_blockdev_count = 0;
|
||||
@ -321,7 +321,7 @@ create_aio_disk(char *fname)
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
fdisk->size = spdk_file_get_size(fdisk->fd);
|
||||
fdisk->size = spdk_fd_get_size(fdisk->fd);
|
||||
fdisk->queue_depth = 128; // TODO: where do we get the queue depth from.
|
||||
|
||||
TAILQ_INIT(&fdisk->sync_completion_list);
|
||||
@ -331,7 +331,7 @@ create_aio_disk(char *fname)
|
||||
|
||||
fdisk->disk.need_aligned_buffer = 1;
|
||||
fdisk->disk.write_cache = 1;
|
||||
fdisk->disk.blocklen = spdk_dev_get_blocklen(fdisk->fd);
|
||||
fdisk->disk.blocklen = spdk_fd_get_blocklen(fdisk->fd);
|
||||
fdisk->disk.blockcnt = fdisk->size / fdisk->disk.blocklen;
|
||||
fdisk->disk.ctxt = fdisk;
|
||||
|
||||
|
@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
CFLAGS += $(DPDK_INC)
|
||||
C_SRCS = file.c string.c pci.c
|
||||
C_SRCS = fd.c string.c pci.c
|
||||
LIBNAME = util
|
||||
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
|
||||
|
@ -31,7 +31,7 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "spdk/file.h"
|
||||
#include "spdk/fd.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
@ -64,7 +64,7 @@ dev_get_size(int fd)
|
||||
}
|
||||
|
||||
uint32_t
|
||||
spdk_dev_get_blocklen(int fd)
|
||||
spdk_fd_get_blocklen(int fd)
|
||||
{
|
||||
#if defined(DKIOCGETBLOCKSIZE) /* FreeBSD */
|
||||
uint32_t blocklen;
|
||||
@ -85,7 +85,7 @@ spdk_dev_get_blocklen(int fd)
|
||||
}
|
||||
|
||||
uint64_t
|
||||
spdk_file_get_size(int fd)
|
||||
spdk_fd_get_size(int fd)
|
||||
{
|
||||
struct stat st;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_lcore.h>
|
||||
|
||||
#include "spdk/file.h"
|
||||
#include "spdk/fd.h"
|
||||
#include "spdk/nvme.h"
|
||||
#include "spdk/pci.h"
|
||||
#include "spdk/string.h"
|
||||
@ -205,14 +205,14 @@ register_aio_file(const char *path)
|
||||
return -1;
|
||||
}
|
||||
|
||||
size = spdk_file_get_size(fd);
|
||||
size = spdk_fd_get_size(fd);
|
||||
if (size == 0) {
|
||||
fprintf(stderr, "Could not determine size of AIO device %s\n", path);
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
blklen = spdk_dev_get_blocklen(fd);
|
||||
blklen = spdk_fd_get_blocklen(fd);
|
||||
if (blklen == 0) {
|
||||
fprintf(stderr, "Could not determine block size of AIO device %s\n", path);
|
||||
close(fd);
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_lcore.h>
|
||||
|
||||
#include "spdk/file.h"
|
||||
#include "spdk/nvme.h"
|
||||
#include "spdk/pci.h"
|
||||
#include "spdk/string.h"
|
||||
|
Loading…
Reference in New Issue
Block a user