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 struct vnode; 14 15 16 class Volume { 17 public: 18 Volume(fs_volume* fsVolume); 19 ~Volume(); 20 21 fs_volume* FSVolume() const { return fFSVolume; } 22 dev_t ID() const { return fFSVolume->id; } 23 24 fs_volume* SourceFSVolume() const 25 { return fSourceFSVolume; } 26 27 Node* RootNode() const { return fRootNode; } 28 const char* Name() const { return fName; } 29 30 status_t Mount(const char* parameterString); 31 void Unmount(); 32 33 const fs_vnode_ops* VnodeOps() const { return &fVnodeOps; } 34 35 private: 36 struct VolumeListener; 37 friend struct VolumeListener; 38 39 private: 40 status_t _InitVnodeOpsFrom(fs_vnode* sourceNode); 41 42 private: 43 fs_volume* fFSVolume; 44 fs_volume* fSourceFSVolume; 45 vnode* fSourceVnode; 46 Node* fRootNode; 47 48 fs_vnode_ops fVnodeOps; 49 50 char fName[B_PATH_NAME_LENGTH]; 51 }; 52 53 54 #endif // VOLUME_H 55