2003-01-29 17:45:15 +03:00
|
|
|
/* Disk device iteration and information
|
|
|
|
**
|
|
|
|
** Distributed under the terms of the OpenBeOS License.
|
2003-01-17 11:22:35 +03:00
|
|
|
*/
|
2002-12-21 22:06:18 +03:00
|
|
|
#ifndef _FS_DEVICE_H
|
|
|
|
#define _FS_DEVICE_H
|
|
|
|
|
2003-01-29 17:45:15 +03:00
|
|
|
|
2002-12-21 22:06:18 +03:00
|
|
|
#include <Drivers.h>
|
|
|
|
#include <OS.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2003-01-29 17:45:15 +03:00
|
|
|
|
2002-12-21 22:06:18 +03:00
|
|
|
// session flags
|
|
|
|
enum {
|
|
|
|
B_DATA_SESSION = 0x01, /* data session */
|
|
|
|
B_VIRTUAL_SESSION = 0x02, /* e.g. hard disk */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct session_info {
|
|
|
|
off_t offset; /* offset from start of device (in bytes) */
|
|
|
|
off_t size; /* size (in bytes) */
|
|
|
|
int32 logical_block_size; /* logical block size (in bytes) */
|
|
|
|
int32 index; /* session index */
|
|
|
|
uint32 flags; /* session flags */
|
|
|
|
} session_info;
|
|
|
|
|
|
|
|
// partition flags
|
|
|
|
enum {
|
|
|
|
B_HIDDEN_PARTITION = 0x01, /* non-file system partition */
|
|
|
|
B_VIRTUAL_PARTITION = 0x02, /* e.g. floppy */
|
|
|
|
B_EMPTY_PARTITION = 0x04, /* empty partition, implies
|
|
|
|
B_HIDDEN_PARTITION */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct extended_partition_info {
|
|
|
|
partition_info info;
|
|
|
|
uint32 flags; /* partition flags */
|
|
|
|
char partition_name[B_FILE_NAME_LENGTH];
|
|
|
|
char partition_type[B_FILE_NAME_LENGTH];
|
|
|
|
char file_system_short_name[B_FILE_NAME_LENGTH]; /* "", if hidden */
|
|
|
|
char file_system_long_name[B_FILE_NAME_LENGTH]; /* or unknown FS */
|
|
|
|
char volume_name[B_FILE_NAME_LENGTH]; /* "", if hidden */
|
2003-02-08 03:37:30 +03:00
|
|
|
// char mounted_at[B_FILE_NAME_LENGTH]; /* "", if not mounted */
|
2002-12-21 22:06:18 +03:00
|
|
|
//< better B_PATH_NAME_LENGTH?
|
2003-01-26 18:01:55 +03:00
|
|
|
uint32 partition_code;
|
|
|
|
uint32 file_system_flags; /* same as fs_info::flags */
|
2002-12-21 22:06:18 +03:00
|
|
|
} extended_partition_info;
|
|
|
|
|
2003-01-29 17:45:15 +03:00
|
|
|
|
2002-12-21 22:06:18 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2003-01-20 01:54:28 +03:00
|
|
|
// getting infos
|
2002-12-21 22:06:18 +03:00
|
|
|
status_t get_nth_session_info(int deviceFD, int32 index,
|
|
|
|
session_info *sessionInfo);
|
|
|
|
status_t get_nth_partition_info(int deviceFD, int32 sessionIndex,
|
|
|
|
int32 partitionIndex,
|
2003-01-26 18:01:55 +03:00
|
|
|
extended_partition_info *partitionInfo,
|
|
|
|
char *partitionMapName);
|
2002-12-21 22:06:18 +03:00
|
|
|
|
2003-01-20 01:54:28 +03:00
|
|
|
// partitioning
|
2003-01-20 01:58:12 +03:00
|
|
|
status_t get_partitioning_parameters(int deviceFD, int32 sessionIndex,
|
|
|
|
const char *identifier, char *buffer,
|
|
|
|
size_t bufferSize, size_t *actualSize);
|
2003-01-20 01:54:28 +03:00
|
|
|
status_t partition_session(int deviceFD, int32 sessionIndex,
|
|
|
|
const char *identifier, const char *parameters);
|
|
|
|
|
|
|
|
// initialization
|
2003-01-20 01:58:12 +03:00
|
|
|
status_t get_fs_initialization_parameters(int deviceFD, int32 sessionIndex,
|
|
|
|
int32 partitionIndex,
|
|
|
|
const char *fileSystem, char *buffer,
|
|
|
|
size_t bufferSize,
|
|
|
|
size_t *actualSize);
|
2003-01-20 01:54:28 +03:00
|
|
|
// TODO: Move to <unistd.h>. It fits better there.
|
|
|
|
status_t initialize_volume(const char *where, const char *fileSystem,
|
|
|
|
const char *volumeName, const char *parameters);
|
|
|
|
|
2002-12-21 22:06:18 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-01-29 17:45:15 +03:00
|
|
|
#endif /* _FS_DEVICE_H */
|