2007-07-31 15:23:23 +00:00
|
|
|
/*
|
2010-10-12 13:03:19 +00:00
|
|
|
* Copyright (C) 2009 Tobias Brunner
|
2007-07-31 15:23:23 +00:00
|
|
|
* Copyright (C) 2007 Martin Willi
|
|
|
|
* Hochschule fuer Technik Rapperswil
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COWFS_H
|
|
|
|
#define COWFS_H
|
|
|
|
|
2007-08-09 07:14:56 +00:00
|
|
|
#include <library.h>
|
2007-07-31 15:23:23 +00:00
|
|
|
|
|
|
|
typedef struct cowfs_t cowfs_t;
|
|
|
|
|
|
|
|
/**
|
2009-05-11 15:24:51 +00:00
|
|
|
* cowfs - Copy on write FUSE filesystem.
|
2007-07-31 15:23:23 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
struct cowfs_t {
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-07-31 15:23:23 +00:00
|
|
|
/**
|
2010-10-12 13:03:19 +00:00
|
|
|
* Adds an additional copy on write overlay.
|
|
|
|
*
|
|
|
|
* If the path was already added as overlay, it is moved to the top.
|
|
|
|
*
|
|
|
|
* @param path path of the overlay
|
|
|
|
* @return FALSE, if failed
|
|
|
|
*/
|
|
|
|
bool (*add_overlay)(cowfs_t *this, char *path);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the specified copy on write overlay.
|
2007-07-31 15:23:23 +00:00
|
|
|
*
|
|
|
|
* @param path path of the overlay
|
2010-10-12 13:03:19 +00:00
|
|
|
* @return FALSE, if not found
|
|
|
|
*/
|
|
|
|
bool (*del_overlay)(cowfs_t *this, char *path);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the most recently added copy on write overlay.
|
|
|
|
*
|
|
|
|
* @return FALSE, if no overlay was found
|
2007-07-31 15:23:23 +00:00
|
|
|
*/
|
2010-10-12 13:03:19 +00:00
|
|
|
bool (*pop_overlay)(cowfs_t *this);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-07-31 15:23:23 +00:00
|
|
|
/**
|
2009-05-11 15:24:51 +00:00
|
|
|
* Stop, umount and destroy a cowfs FUSE filesystem.
|
2007-07-31 15:23:23 +00:00
|
|
|
*/
|
|
|
|
void (*destroy) (cowfs_t *this);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2009-05-11 15:24:51 +00:00
|
|
|
* Mount a cowfs FUSE filesystem.
|
2007-07-31 15:23:23 +00:00
|
|
|
*
|
|
|
|
* @param master read only master file system directory
|
|
|
|
* @param host copy on write host directory
|
|
|
|
* @param mount mountpoint where union is mounted
|
2014-02-18 09:35:02 +00:00
|
|
|
* @return instance, or NULL if FUSE initialization failed
|
2007-07-31 15:23:23 +00:00
|
|
|
*/
|
|
|
|
cowfs_t *cowfs_create(char *master, char *host, char *mount);
|
|
|
|
|
|
|
|
#endif /* COWFS_H */
|
|
|
|
|