1 /* 2 * Copyright 2003-2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <bonefish@cs.tu-berlin.de> 7 * 8 * KFileSystem implements the KDiskSystem interface for file systems. 9 */ 10 #ifndef _K_FILE_DISK_DEVICE_SYSTEM_H 11 #define _K_FILE_DISK_DEVICE_SYSTEM_H 12 13 #include "KDiskSystem.h" 14 15 16 struct file_system_module_info; 17 18 19 namespace BPrivate { 20 namespace DiskDevice { 21 22 23 //! \brief Wrapper for the C interface of a filesystem add-on. 24 class KFileSystem : public KDiskSystem { 25 public: 26 KFileSystem(const char* name); 27 virtual ~KFileSystem(); 28 29 virtual status_t Init(); 30 31 // Scanning 32 33 virtual float Identify(KPartition* partition, void** cookie); 34 virtual status_t Scan(KPartition* partition, void* cookie); 35 virtual void FreeIdentifyCookie(KPartition* partition, 36 void* cookie); 37 virtual void FreeContentCookie(KPartition* partition); 38 39 // Writing 40 41 virtual status_t Defragment(KPartition* partition, 42 disk_job_id job); 43 virtual status_t Repair(KPartition* partition, bool checkOnly, 44 disk_job_id job); 45 virtual status_t Resize(KPartition* partition, off_t size, 46 disk_job_id job); 47 virtual status_t Move(KPartition* partition, off_t offset, 48 disk_job_id job); 49 virtual status_t SetContentName(KPartition* partition, 50 const char* name, disk_job_id job); 51 virtual status_t SetContentParameters(KPartition* partition, 52 const char* parameters, disk_job_id job); 53 virtual status_t Initialize(KPartition* partition, 54 const char* name, const char* parameters, 55 disk_job_id job); 56 virtual status_t Uninitialize(KPartition* partition, 57 disk_job_id job); 58 59 protected: 60 virtual status_t LoadModule(); 61 virtual void UnloadModule(); 62 63 private: 64 file_system_module_info* fModule; 65 }; 66 67 68 } // namespace DiskDevice 69 } // namespace BPrivate 70 71 using BPrivate::DiskDevice::KFileSystem; 72 73 #endif // _K_FILE_DISK_DEVICE_SYSTEM_H 74