Spdk/include/spdk/blobfs_bdev.h
paul luse a6dbe3721e update Intel copyright notices
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the 4 digit year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc).  Contribution date used
"--follow -C95%" to get the most accurate date.

Note that several files in this patch didn't end the license/(c)
block with a blank comment line so these were added as the vast
majority of files do have this last blank line.  Simply there for
consistency.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2022-11-10 08:28:53 +00:00

71 lines
2.0 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (C) 2019 Intel Corporation.
* All rights reserved.
*/
/** \file
* Operations on blobfs whose backing device is spdk_bdev
*/
#ifndef SPDK_BLOBFS_BDEV_H
#define SPDK_BLOBFS_BDEV_H
#include "spdk/stdinc.h"
#include "spdk/bdev.h"
#include "spdk/config.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* blobfs on bdev operation completion callback.
*
* \param cb_arg Callback argument.
* \param fserrno 0 if it completed successfully, or negative errno if it failed.
*/
typedef void (*spdk_blobfs_bdev_op_complete)(void *cb_arg, int fserrno);
/**
* Detect whether blobfs exists on the given device.
*
* \param bdev_name Name of block device.
* \param cb_fn Called when the detecting is complete. fserrno is -EILSEQ if no blobfs exists.
* \param cb_arg Argument passed to function cb_fn.
*/
void spdk_blobfs_bdev_detect(const char *bdev_name,
spdk_blobfs_bdev_op_complete cb_fn, void *cb_arg);
/**
* Create a blobfs on the given device.
*
* \param bdev_name Name of block device.
* \param cluster_sz Size of cluster in bytes. Must be multiple of 4KiB page size.
* \param cb_fn Called when the creation is complete.
* \param cb_arg Argument passed to function cb_fn.
*/
void spdk_blobfs_bdev_create(const char *bdev_name, uint32_t cluster_sz,
spdk_blobfs_bdev_op_complete cb_fn, void *cb_arg);
#ifdef SPDK_CONFIG_FUSE
/**
* Mount a blobfs on given device to a host path by FUSE
*
* A new thread is created dedicatedly for one mountpoint to handle FUSE request
* by blobfs API.
*
* \param bdev_name Name of block device.
* \param mountpoint Host path to mount blobfs.
* \param cb_fn Called when mount operation is complete. fserrno is -EILSEQ if no blobfs exists.
* \param cb_arg Argument passed to function cb_fn.
*/
void spdk_blobfs_bdev_mount(const char *bdev_name, const char *mountpoint,
spdk_blobfs_bdev_op_complete cb_fn, void *cb_arg);
#endif
#ifdef __cplusplus
}
#endif
#endif /* SPDK_BLOBFS_BDEV_H */