summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-09-20 16:11:09 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-09-20 16:11:09 +0100
commit0721b2cb0e63c6968c8bda00df1ff0018cad6e4f (patch)
treeb9c0a4eb8cf97b75f96b9262123dae15f97d67d0
parentCommon base for mappers (diff)
downloadnetfs-0721b2cb0e63c6968c8bda00df1ff0018cad6e4f.tar.bz2
netfs-0721b2cb0e63c6968c8bda00df1ff0018cad6e4f.tar.xz
netfs-0721b2cb0e63c6968c8bda00df1ff0018cad6e4f.zip
Move not template functions out of impl.h
-rw-r--r--netfs/lib/entCache.cpp42
-rw-r--r--netfs/lib/entCache.impl.h42
2 files changed, 42 insertions, 42 deletions
diff --git a/netfs/lib/entCache.cpp b/netfs/lib/entCache.cpp
index e1a20a5..6f6d6eb 100644
--- a/netfs/lib/entCache.cpp
+++ b/netfs/lib/entCache.cpp
@@ -3,3 +3,45 @@
template class EntCache<User>;
template class EntCache<Group>;
+
+const int BUFLEN = 8196;
+
+void
+UserEntCache::fillCache() const noexcept
+{
+ Lock(lock);
+ setpwent();
+ idcache->clear();
+ std::array<char, BUFLEN> buf {};
+ struct passwd pwbuf {
+ }, *pwp;
+ while (getpwent_r(&pwbuf, buf.data(), buf.size(), &pwp) == 0) {
+ idcache->insert(std::make_shared<User>(pwp->pw_uid, pwp->pw_name, pwp->pw_gid));
+ }
+ endpwent();
+ time(&fillTime);
+}
+
+GroupEntCache::GroupEntCache(EntryResolverPtr<User> u) : users(std::move(u)) { }
+
+void
+GroupEntCache::fillCache() const noexcept
+{
+ Lock(lock);
+ setgrent();
+ std::array<char, BUFLEN> buf {};
+ idcache->clear();
+ struct group grpbuf {
+ }, *grp;
+ while (getgrent_r(&grpbuf, buf.data(), buf.size(), &grp) == 0) {
+ auto g = std::make_shared<Group>(grp->gr_gid, grp->gr_name);
+ for (auto member = grp->gr_mem; *member; member++) {
+ if (auto ent = users->getEntry(*member)) {
+ g->members.insert(ent->id);
+ }
+ }
+ idcache->insert(std::move(g));
+ }
+ endgrent();
+ time(&fillTime);
+}
diff --git a/netfs/lib/entCache.impl.h b/netfs/lib/entCache.impl.h
index 1d7bbc7..5e6289e 100644
--- a/netfs/lib/entCache.impl.h
+++ b/netfs/lib/entCache.impl.h
@@ -51,46 +51,4 @@ EntCache<entry_t>::getEntryNoFill(const key_t & key) const noexcept
return nullptr;
}
-const int BUFLEN = 8196;
-
-void
-UserEntCache::fillCache() const noexcept
-{
- Lock(lock);
- setpwent();
- idcache->clear();
- std::array<char, BUFLEN> buf {};
- struct passwd pwbuf {
- }, *pwp;
- while (getpwent_r(&pwbuf, buf.data(), buf.size(), &pwp) == 0) {
- idcache->insert(std::make_shared<User>(pwp->pw_uid, pwp->pw_name, pwp->pw_gid));
- }
- endpwent();
- time(&fillTime);
-}
-
-GroupEntCache::GroupEntCache(EntryResolverPtr<User> u) : users(std::move(u)) { }
-
-void
-GroupEntCache::fillCache() const noexcept
-{
- Lock(lock);
- setgrent();
- std::array<char, BUFLEN> buf {};
- idcache->clear();
- struct group grpbuf {
- }, *grp;
- while (getgrent_r(&grpbuf, buf.data(), buf.size(), &grp) == 0) {
- auto g = std::make_shared<Group>(grp->gr_gid, grp->gr_name);
- for (auto member = grp->gr_mem; *member; member++) {
- if (auto ent = users->getEntry(*member)) {
- g->members.insert(ent->id);
- }
- }
- idcache->insert(std::move(g));
- }
- endgrent();
- time(&fillTime);
-}
-
#endif