chiark / gitweb /
Add a config option to suppres rescan on (un)mount.
authorRichard Kettlewell <rjk@greenend.org.uk>
Tue, 8 Jun 2010 22:09:54 +0000 (23:09 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Tue, 8 Jun 2010 22:09:54 +0000 (23:09 +0100)
CHANGES.html
doc/disorder_config.5.in
lib/configuration.c
lib/configuration.h
server/mount.c

index 0f78a56cfc62ec32600e0bfd938e44af6b69752f..53c9fa031e50466f0885d3c78ec6a1da4a3142de 100644 (file)
@@ -77,7 +77,8 @@ span.command {
   <div class=section>
 
     <p>The server will now automatically initiate a rescan when a filesystem is
-    mounted or unmounted.</p>
+    mounted or unmounted.  (Use the <tt>mount_rescan</tt> option if you want to
+    suppress this behavior.)</p>
 
     <p>The server takes care not to hold audio files open unnecessarily, so
     that devices can be unmounted even if tracks from them are currently being
index a5b55ba6f14f878a2e9285b48b4e3ef05af8ef10..0c8f7c8f490025a5693b64724cc50a27906da047 100644 (file)
@@ -325,7 +325,6 @@ For \fBapi oss\fR the possible values are:
 .RS
 .TP 8
 .B pcm
-
 Output level for the audio device.
 This is probably what you want and is the default.
 .TP
@@ -457,6 +456,10 @@ The default is 0.
 .IP
 For \fBapi coreaudio\fR, volume setting is not currently supported.
 .TP
+.B mount_rescan yes\fR|\fBno
+Determines whether mounts and unmounts will cause an automatic rescan.
+The default is \fByes\fR.
+.TP
 .B multicast_loop yes\fR|\fBno
 Determines whether multicast packets are loop backed to the sending host.
 The default is \fByes\fR.
index 45f232946155facab3c55e9c761b64f446fd16a2..0b173d4113e22098ff0c52d017725dd958bfe245 100644 (file)
@@ -1080,6 +1080,7 @@ static const struct conf conf[] = {
   { C(lock),             &type_boolean,          validate_any },
   { C(mail_sender),      &type_string,           validate_any },
   { C(mixer),            &type_string,           validate_any },
+  { C(mount_rescan),     &type_boolean,          validate_any },
   { C(multicast_loop),   &type_boolean,          validate_any },
   { C(multicast_ttl),    &type_integer,          validate_non_negative },
   { C(namepart),         &type_namepart,         validate_any },
@@ -1373,6 +1374,7 @@ static struct config *config_default(void) {
   c->sox_generation = DEFAULT_SOX_GENERATION;
   c->playlist_max = INT_MAX;            /* effectively no limit */
   c->playlist_lock_timeout = 10;        /* 10s */
+  c->mount_rescan = 1;
   /* Default stopwords */
   if(config_set(&cs, (int)NDEFAULT_STOPWORDS, (char **)default_stopwords))
     exit(1);
index 617d9293480948d5078279515f1bb84780595127..22e107d62be9b746b379b9b551317bed28095a3a 100644 (file)
@@ -290,7 +290,10 @@ struct config {
 
   /** @brief Maximum bias */
   long new_bias;
-  
+
+  /** @brief Rescan on (un)mount */
+  int mount_rescan;
+
   /* derived values: */
   int nparts;                          /* number of distinct name parts */
   char **parts;                                /* name part list  */
index 506b66374c0dba121349e8783e7c12a4b16cc01f..8b1c60245e1ef649f540882196f2b74329348ad6 100644 (file)
@@ -41,6 +41,8 @@ static int compare_fsstat(const void *av, const void *bv) {
 #endif
 
 void periodic_mount_check(ev_source *ev_) {
+  if(!config->mount_rescan)
+    return;
 #if HAVE_GETFSSTAT
   /* On OS X, we keep track of the hash of the kernel's mounted
    * filesystem list */