ESDM
Middleware for Earth System Data
Data Structures | Macros | Functions
posix.c File Reference

A data backend to provide POSIX compatibility. More...

#include <dirent.h>
#include <errno.h>
#include <esdm-debug.h>
#include <esdm.h>
#include <fcntl.h>
#include <jansson.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <esdm-stream.h>
#include "posix.h"
Include dependency graph for posix.c:

Data Structures

struct  posix_stream_t
 

Macros

#define _GNU_SOURCE   /* See feature_test_macros(7) */
 
#define DEBUG_ENTER   ESDM_DEBUG_COM_FMT("POSIX", "", "")
 
#define DEBUG(fmt, ...)   ESDM_DEBUG_COM_FMT("POSIX", fmt, __VA_ARGS__)
 
#define WARN_ENTER   ESDM_WARN_COM_FMT("POSIX", "", "")
 
#define WARN(fmt, ...)   ESDM_WARN_COM_FMT("POSIX", fmt, __VA_ARGS__)
 
#define WARNS(fmt)   ESDM_WARN_COM_FMT("POSIX", "%s", fmt)
 
#define sprintfFragmentDir(path, f)   (sprintf(path, "%s/%c/%c/%s/%c/%c", tgt, f->dataset->id[0], f->dataset->id[1], f->dataset->id+2, f->id[0], f->id[1]))
 
#define sprintfFragmentPath(path, f)   (sprintf(path, "%s/%c/%c/%s/%c/%c/%s", tgt, f->dataset->id[0], f->dataset->id[1], f->dataset->id+2, f->id[0], f->id[1], f->id+2))
 

Functions

int posix_finalize (esdm_backend_t *backend)
 
esdm_backend_tposix_backend_init (esdm_config_backend_t *config)
 

Detailed Description

A data backend to provide POSIX compatibility.

Function Documentation

◆ posix_backend_init()

esdm_backend_t* posix_backend_init ( esdm_config_backend_t config)

Initializes the POSIX plugin. In particular this involves:

  • Load configuration of this backend
  • Load and potentially calibrate performance model
  • Connect with support services e.g. for technical metadata
  • Setup directory structures used by this POSIX specific backend
  • Populate esdm_backend_t struct and callbacks required for registration
Returns
pointer to backend struct

◆ posix_finalize()

int posix_finalize ( esdm_backend_t backend)

Finalize callback implementation called on ESDM shutdown.

This is the last chance for a backend to make outstanding changes persistent. This routine is also expected to clean up memory that is used by the backend.