#define BTRFS_SUPER_MAGIC 0x9123683E
#endif
-struct handle_data {
+typedef struct HandleData {
int mountfd;
int handle_bytes;
-};
+} HandleData;
static inline int name_to_handle(int dirfd, const char *name,
struct file_handle *fh, int *mnt_id, int flags)
struct stat *stbuf)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
if (fd < 0) {
char *buf, size_t bufsz)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
if (fd < 0) {
static int handle_open(FsContext *ctx, V9fsPath *fs_path,
int flags, V9fsFidOpenState *fs)
{
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fs->fd = open_by_handle(data->mountfd, fs_path->data, flags);
return fs->fd;
static int handle_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
const char *name, FsCred *credp)
{
int dirfd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
if (dirfd < 0) {
const char *name, FsCred *credp)
{
int dirfd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
if (dirfd < 0) {
{
int ret;
int dirfd, fd;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
if (dirfd < 0) {
V9fsPath *dir_path, const char *name, FsCred *credp)
{
int fd, dirfd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
if (dirfd < 0) {
V9fsPath *dirpath, const char *name)
{
int oldfd, newdirfd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
oldfd = open_by_handle(data->mountfd, oldpath->data, O_PATH);
if (oldfd < 0) {
static int handle_truncate(FsContext *ctx, V9fsPath *fs_path, off_t size)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK | O_WRONLY);
if (fd < 0) {
static int handle_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)fs_ctx->private;
+ HandleData *data = (HandleData *) fs_ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
if (fd < 0) {
{
int ret;
int fd;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
struct statfs *stbuf)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
const char *name, void *value, size_t size)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
void *value, size_t size)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
void *value, size_t size, int flags)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
const char *name)
{
int fd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if (fd < 0) {
char *buffer;
struct file_handle *fh;
int dirfd, ret, mnt_id;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
/* "." and ".." are not allowed */
if (!strcmp(name, ".") || !strcmp(name, "..")) {
const char *new_name)
{
int olddirfd, newdirfd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
olddirfd = open_by_handle(data->mountfd, olddir->data, O_PATH);
if (olddirfd < 0) {
const char *name, int flags)
{
int dirfd, ret;
- struct handle_data *data = (struct handle_data *)ctx->private;
+ HandleData *data = (HandleData *) ctx->private;
int rflags;
dirfd = open_by_handle(data->mountfd, dir->data, O_PATH);
int ret, mnt_id;
struct statfs stbuf;
struct file_handle fh;
- struct handle_data *data = g_malloc(sizeof(struct handle_data));
+ HandleData *data = g_malloc(sizeof(HandleData));
data->mountfd = open(ctx->fs_root, O_DIRECTORY);
if (data->mountfd < 0) {
static void handle_cleanup(FsContext *ctx)
{
- struct handle_data *data = ctx->private;
+ HandleData *data = ctx->private;
close(data->mountfd);
g_free(data);