Files
haiku-beta6/headers/private/kernel/disk_device_manager/KFileSystem.h
T
Ingo Weinhold bf95c9aee6 * The shadow_changed() FS and partitioning system hooks take an
additional partition_data* child parameter now.
* _user_get_partitionable_spaces() doesn't need to copy the buffer into
  the kernel, since it is no input parameter. It also copies back the
  actual partitionable spaces count on error, now -- B_BUFFER_OVERFLOW
  is returned when the buffer was too small, but then the count must be
  returned too.
* Fixed several instances of syscall implementations that unloaded a disk
  system, although they didn't load it in the first place. This screwed
  up the load count with undesirable consequences.
* _user_create_child_partition() would set the size to the supplied
  offset.
* Fixed broken loop in KPhysicalPartition::CreateShadowPartition().
* KPartition::RemoveChild() notified the listeners about the wrong
  event.
* Intel partitioning module:
  - The *_get_partitionable_spaces() correctly return B_BUFFER_OVERFLOW
    now, if the supplied buffer is too small.
  - Implemented a part of pm_shadow_changed(), which creates and updates
    the PartitionMap, so that the validate_*() hooks have a chance to
    work at all.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 15:39:35 +00:00

84 lines
2.5 KiB
C++

/*
* Copyright 2003-2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold <[email protected]>
*
* KFileSystem implements the KDiskSystem interface for file systems.
* It works with the FS API.
*/
#ifndef _K_FILE_DISK_DEVICE_SYSTEM_H
#define _K_FILE_DISK_DEVICE_SYSTEM_H
#include "KDiskSystem.h"
struct file_system_module_info;
namespace BPrivate {
namespace DiskDevice {
//! \brief Wrapper for the C interface of a filesystem add-on.
class KFileSystem : public KDiskSystem {
public:
KFileSystem(const char *name);
virtual ~KFileSystem();
virtual status_t Init();
// Scanning
virtual float Identify(KPartition *partition, void **cookie);
virtual status_t Scan(KPartition *partition, void *cookie);
virtual void FreeIdentifyCookie(KPartition *partition, void *cookie);
virtual void FreeContentCookie(KPartition *partition);
// Querying
virtual uint32 GetSupportedOperations(KPartition* partition, uint32 mask);
virtual bool ValidateResize(KPartition *partition, off_t *size);
virtual bool ValidateMove(KPartition *partition, off_t *start);
virtual bool ValidateSetContentName(KPartition *partition, char *name);
virtual bool ValidateSetContentParameters(KPartition *partition,
const char *parameters);
virtual bool ValidateInitialize(KPartition *partition, char *name,
const char *parameters);
// Shadow partition modification
virtual status_t ShadowPartitionChanged(KPartition *partition,
KPartition *child, uint32 operation);
// Writing
virtual status_t Defragment(KPartition *partition, KDiskDeviceJob *job);
virtual status_t Repair(KPartition *partition, bool checkOnly,
KDiskDeviceJob *job);
virtual status_t Resize(KPartition *partition, off_t size,
KDiskDeviceJob *job);
virtual status_t Move(KPartition *partition, off_t offset,
KDiskDeviceJob *job);
virtual status_t SetContentName(KPartition *partition, char *name,
KDiskDeviceJob *job);
virtual status_t SetContentParameters(KPartition *partition,
const char *parameters,
KDiskDeviceJob *job);
virtual status_t Initialize(KPartition *partition, const char *name,
const char *parameters, KDiskDeviceJob *job);
protected:
virtual status_t LoadModule();
virtual void UnloadModule();
private:
file_system_module_info *fModule;
};
} // namespace DiskDevice
} // namespace BPrivate
using BPrivate::DiskDevice::KFileSystem;
#endif // _K_FILE_DISK_DEVICE_SYSTEM_H