2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Paweł Dziepak, pdziepak@quarnos.org
8 #ifndef METADATACACHE_H
9 #define METADATACACHE_H
12 #include <fs_interface.h>
14 #include <SupportDefs.h>
15 #include <util/AutoLock.h>
16 #include <util/AVLTreeMap.h>
30 MetadataCache(Inode
* inode
);
33 status_t
GetStat(struct stat
* st
);
34 void SetStat(const struct stat
& st
);
35 void GrowFile(size_t newSize
);
37 status_t
GetAccess(uid_t uid
, uint32
* allowed
);
38 void SetAccess(uid_t uid
, uint32 allowed
);
43 inline void InvalidateStat();
44 inline void InvalidateAccess();
46 inline void Invalidate();
48 static const time_t kExpirationTime
= 60;
51 void NotifyChanges(const struct stat
* oldStat
,
52 const struct stat
* newStat
);
55 struct stat fStatCache
;
62 AVLTreeMap
<uid_t
, AccessEntry
> fAccessCache
;
69 MetadataCache::InvalidateStat()
78 MetadataCache::InvalidateAccess()
82 fAccessCache
.MakeEmpty();
87 MetadataCache::Invalidate()
94 #endif // METADATACACHE_H