2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2015 Kern Sibbald
6 The original author of Bacula is Kern Sibbald, with contributions
7 from many others, a complete list can be found in the file AUTHORS.
9 You may use this file and others of this release according to the
10 license defined in the LICENSE file, which includes the Affero General
11 Public License, v3.0 ("AGPLv3") and some additional permissions and
12 terms pursuant to its AGPLv3 Section 7.
14 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
21 * Bacula Director -- mountreq.c -- handles the message channel
22 * Mount request from the Storage daemon.
24 * Kern Sibbald, March MMI
26 * This routine runs as a thread and must be thread reentrant.
28 * Basic tasks done here:
29 * Handle Mount services.
37 * Handle mount request
38 * For now, we put the bsock in the UA's queue
41 /* Requests from the Storage daemon */
44 /* Responses sent to Storage daemon */
46 static char OK_mount[] = "1000 OK MountVolume\n";
49 static BQUEUE mountq = {&mountq, &mountq};
50 static int num_reqs = 0;
51 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
53 typedef struct mnt_req_s {
60 void mount_request(JCR *jcr, BSOCK *bs, char *buf)
64 mreq = (MNT_REQ *) malloc(sizeof(MNT_REQ));
65 memset(mreq, 0, sizeof(MNT_REQ));
70 qinsert(&mountq, &mreq->bq);