CernVM-FS  2.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fs_traversal_interface.h
Go to the documentation of this file.
1 
4 #ifndef CVMFS_SHRINKWRAP_FS_TRAVERSAL_INTERFACE_H_
5 #define CVMFS_SHRINKWRAP_FS_TRAVERSAL_INTERFACE_H_
6 
7 #include "libcvmfs.h"
8 
9 #define COPY_BUFFER_SIZE 4096
10 
12  uint64_t version;
13  uint64_t size;
14 
15  char *repo;
16  char *base;
17  char *data;
18  char *config;
19  char *lib_version;
20 
21  void *ctx;
22 };
23 
28 };
29 
30 struct fs_traversal {
37 
49  struct fs_traversal_context *(*initialize)(const char *repo,
50  const char *base,
51  const char *data,
52  const char *config,
53  int num_threads);
54 
64  void (*finalize)(struct fs_traversal_context *ctx);
65 
74  struct fs_traversal_context *dest);
75 
86  const char *dir,
87  char ***buf,
88  size_t *len);
89 
114  int (*get_stat)(struct fs_traversal_context *ctx, const char *path,
115  struct cvmfs_attr *stat, bool get_hash);
116 
134  const struct cvmfs_attr *stat);
135 
146  int (*set_meta)(struct fs_traversal_context *ctx, const char *path,
147  const struct cvmfs_attr *stat);
148 
160  char *(*get_identifier)(struct fs_traversal_context *ctx,
161  const struct cvmfs_attr *stat);
162 
163 
173  bool (*has_file)(struct fs_traversal_context *ctx, const char *identifier);
174 
195  const char *path,
196  const char *identifier);
197 
209  int (*do_unlink)(struct fs_traversal_context *ctx, const char *path);
210 
225  const char *path,
226  const struct cvmfs_attr *stat);
227 
238  int (*do_rmdir)(struct fs_traversal_context *ctx, const char *path);
239 
251  int (*touch)(struct fs_traversal_context *ctx, const struct cvmfs_attr *stat);
252 
263  void *(*get_handle)(struct fs_traversal_context *ctx, const char *identifier);
264 
265 
286  const char *src,
287  const char *dest,
288  const struct cvmfs_attr *stat_info);
289 
303 
312  int (*do_fopen)(void *file_ctx, fs_open_type op_mode);
313 
323  int (*do_fclose)(void *file_ctx);
324 
335  int (*do_fread)(void *file_ctx, char *buff, size_t len, size_t *read_len);
336 
346  int (*do_fwrite)(void *file_ctx, const char *buff, size_t len);
347 
351  void (*do_ffree)(void *file_ctx);
352 };
353 
354 #endif // CVMFS_SHRINKWRAP_FS_TRAVERSAL_INTERFACE_H_
struct cvmcache_context * ctx
int(* do_fopen)(void *file_ctx, fs_open_type op_mode)
int(* set_meta)(struct fs_traversal_context *ctx, const char *path, const struct cvmfs_attr *stat)
bool(* is_hash_consistent)(struct fs_traversal_context *ctx, const struct cvmfs_attr *stat)
int(* do_unlink)(struct fs_traversal_context *ctx, const char *path)
int(* garbage_collector)(struct fs_traversal_context *ctx)
int(* do_rmdir)(struct fs_traversal_context *ctx, const char *path)
void(* do_ffree)(void *file_ctx)
int(* touch)(struct fs_traversal_context *ctx, const struct cvmfs_attr *stat)
int(* do_symlink)(struct fs_traversal_context *ctx, const char *src, const char *dest, const struct cvmfs_attr *stat_info)
void(* finalize)(struct fs_traversal_context *ctx)
int(* do_link)(struct fs_traversal_context *ctx, const char *path, const char *identifier)
void(* list_dir)(struct fs_traversal_context *ctx, const char *dir, char ***buf, size_t *len)
void(* archive_provenance)(struct fs_traversal_context *src, struct fs_traversal_context *dest)
bool(* has_file)(struct fs_traversal_context *ctx, const char *identifier)
int(* do_fclose)(void *file_ctx)
int(* get_stat)(struct fs_traversal_context *ctx, const char *path, struct cvmfs_attr *stat, bool get_hash)
int(* do_fwrite)(void *file_ctx, const char *buff, size_t len)
int(* do_fread)(void *file_ctx, char *buff, size_t len, size_t *read_len)
int(* do_mkdir)(struct fs_traversal_context *ctx, const char *path, const struct cvmfs_attr *stat)
struct fs_traversal_context * context_