]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
sigquit
[netatalk.git] / etc / afpd / volume.c
index b5b843bc6c1cb3452f280d63a9bddd601509e434..519c0c977e9a4f847450c891ceb3b4e13d0a3000 100644 (file)
@@ -512,11 +512,8 @@ static void volset(struct vol_option *options, struct vol_option *save,
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_TM;
             else if (strcasecmp(p, "searchdb") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_SEARCHDB;
-/* Found this in branch dir-rewrite, maybe we want to use it sometimes */
-#if 0
-            else if (strcasecmp(p, "cdrom") == 0)
-                options[VOLOPT_FLAGS].i_value |= AFPVOL_CDROM | AFPVOL_RO;
-#endif
+            else if (strcasecmp(p, "nonetids") == 0)
+                options[VOLOPT_FLAGS].i_value |= AFPVOL_NONETIDS;
             p = strtok(NULL, ",");
         }
 
@@ -1451,6 +1448,7 @@ static int getused_stat(const char *path,
     return 0;
 }
 
+#define GETUSED_CACHETIME 5
 /*!
  * Calculate used size of a volume with nftw
  *
@@ -1471,12 +1469,14 @@ static int getused(const struct vol *vol)
     time_t now = time(NULL);
 
     if (!vol_mtime
-        || (!vol->v_mtime && ((vol_mtime + 30) < now))
-        || (vol->v_mtime && ((vol_mtime + 30) < vol->v_mtime))
+        || (!vol->v_mtime && ((vol_mtime + GETUSED_CACHETIME) < now))
+        || (vol->v_mtime && ((vol_mtime + GETUSED_CACHETIME) < vol->v_mtime))
         ) {
         vol_mtime = now;
         getused_size = 0;
         ret = nftw(vol->v_path, getused_stat, NULL, 20, FTW_PHYS); /* 2 */
+        LOG(log_debug, logtype_afpd, "volparams: from nftw: %" PRIu64 " bytes",
+            getused_size);
     } else {
         LOG(log_debug, logtype_afpd, "volparams: cached used: %" PRIu64 " bytes",
             getused_size);
@@ -1654,7 +1654,8 @@ static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, cha
                         ashort |= VOLPBIT_ATTR_UNIXPRIV;
                     if (vol->v_flags & AFPVOL_TM)
                         ashort |= VOLPBIT_ATTR_TM;
-
+                    if (vol->v_flags & AFPVOL_NONETIDS)
+                        ashort |= VOLPBIT_ATTR_NONETIDS;
                     if (afp_version >= 32) {
                         if (vol->v_vfs_ea)
                             ashort |= VOLPBIT_ATTR_EXT_ATTRS;