btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / nfs4 / RootInode.h
blob8fff6adc1a0cb7de576e9c070a690c72ede0de12
1 /*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Paweł Dziepak, pdziepak@quarnos.org
7 */
8 #ifndef ROOTINODE_H
9 #define ROOTINODE_H
12 #include <fs_info.h>
14 #include "Inode.h"
17 class RootInode : public Inode {
18 public:
19 RootInode();
20 ~RootInode();
22 virtual const char* Name() const;
23 inline void SetName(const char* name);
25 status_t ReadInfo(struct fs_info* info);
26 inline void MakeInfoInvalid();
28 inline uint32 IOSize();
30 bool ProbeMigration();
31 status_t GetLocations(AttrValue** attr);
33 private:
34 struct fs_info fInfoCache;
35 mutex fInfoCacheLock;
36 time_t fInfoCacheExpire;
38 const char* fName;
40 uint32 fIOSize;
42 status_t _UpdateInfo(bool force = false);
47 inline void
48 RootInode::MakeInfoInvalid()
50 fInfoCacheExpire = 0;
54 inline uint32
55 RootInode::IOSize()
57 if (fIOSize == 0)
58 _UpdateInfo(true);
59 return fIOSize;
63 inline void
64 RootInode::SetName(const char* name)
66 ASSERT(name != NULL);
68 free(const_cast<char*>(fName));
69 fName = strdup(name);
73 #endif // ROOTINODE_H