Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 17:38:16 -05:00
|
|
|
/*
|
2016-08-24 08:45:15 -04:00
|
|
|
* Copyright (c) 2015, 2016 Jonas 'Sortie' Termansen.
|
Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 17:38:16 -05:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* mount/filesystem.h
|
|
|
|
* Filesystem abstraction.
|
|
|
|
*/
|
2015-03-07 07:34:43 -05:00
|
|
|
|
|
|
|
#ifndef INCLUDE_MOUNT_FILESYSTEM_H
|
|
|
|
#define INCLUDE_MOUNT_FILESYSTEM_H
|
|
|
|
|
|
|
|
#if !defined(__cplusplus)
|
|
|
|
#include <stdbool.h>
|
|
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include <mount/error.h>
|
|
|
|
|
|
|
|
struct blockdevice;
|
|
|
|
struct filesystem;
|
|
|
|
struct filesystem_handler;
|
|
|
|
|
|
|
|
#define FILESYSTEM_FLAG_UUID (1 << 0)
|
|
|
|
#define FILESYSTEM_FLAG_FSCK_SHOULD (1 << 1)
|
|
|
|
#define FILESYSTEM_FLAG_FSCK_MUST (1 << 2)
|
2016-08-24 08:45:15 -04:00
|
|
|
#define FILESYSTEM_FLAG_NOT_FILESYSTEM (1 << 3)
|
2015-03-07 07:34:43 -05:00
|
|
|
|
|
|
|
struct filesystem
|
|
|
|
{
|
|
|
|
struct blockdevice* bdev;
|
|
|
|
const struct filesystem_handler* handler;
|
|
|
|
void* handler_private;
|
|
|
|
const char* fstype_name;
|
|
|
|
const char* fsck;
|
|
|
|
const char* driver;
|
|
|
|
int flags;
|
|
|
|
unsigned char uuid[16];
|
|
|
|
void* user_ctx;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct filesystem_handler
|
|
|
|
{
|
|
|
|
const char* handler_name;
|
|
|
|
size_t (*probe_amount)(struct blockdevice*);
|
|
|
|
bool (*probe)(struct blockdevice*, const unsigned char*, size_t);
|
|
|
|
enum filesystem_error (*inspect)(struct filesystem**, struct blockdevice*);
|
|
|
|
void (*release)(struct filesystem*);
|
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
const char* filesystem_error_string(enum filesystem_error);
|
|
|
|
enum filesystem_error
|
|
|
|
blockdevice_inspect_filesystem(struct filesystem**, struct blockdevice*);
|
|
|
|
void filesystem_release(struct filesystem*);
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|