1 /* 2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de> 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef VOLUME_H 6 #define VOLUME_H 7 8 9 #include <fs_interface.h> 10 11 12 class Node; 13 14 15 class Volume { 16 public: 17 Volume(fs_volume* fsVolume); 18 ~Volume(); 19 20 fs_volume* FSVolume() const { return fFSVolume; } 21 dev_t ID() const { return fFSVolume->id; } 22 23 fs_volume* SourceFSVolume() const 24 { return fSourceFSVolume; } 25 26 Node* RootNode() const { return fRootNode; } 27 const char* Name() const { return fName; } 28 29 status_t Mount(const char* parameterString); 30 void Unmount(); 31 32 const fs_vnode_ops* VnodeOps() const { return &fVnodeOps; } 33 34 private: 35 struct VolumeListener; 36 friend struct VolumeListener; 37 38 private: 39 status_t _InitVnodeOpsFrom(fs_vnode* sourceNode); 40 41 private: 42 fs_volume* fFSVolume; 43 fs_volume* fSourceFSVolume; 44 Node* fRootNode; 45 46 fs_vnode_ops fVnodeOps; 47 48 char fName[B_PATH_NAME_LENGTH]; 49 }; 50 51 52 #endif // VOLUME_H 53