3 * Bacula Director -- mountreq.c -- handles the message channel
4 * Mount request from the Storage daemon.
6 * Kern Sibbald, March MMI
8 * This routine runs as a thread and must be thread reentrant.
10 * Basic tasks done here:
11 * Handle Mount services.
16 Bacula® - The Network Backup Solution
18 Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
20 The main author of Bacula is Kern Sibbald, with contributions from
21 many others, a complete list can be found in the file AUTHORS.
22 This program is Free Software; you can redistribute it and/or
23 modify it under the terms of version two of the GNU General Public
24 License as published by the Free Software Foundation and included
27 This program is distributed in the hope that it will be useful, but
28 WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 General Public License for more details.
32 You should have received a copy of the GNU General Public License
33 along with this program; if not, write to the Free Software
34 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
37 Bacula® is a registered trademark of John Walker.
38 The licensor of Bacula is the Free Software Foundation Europe
39 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
40 Switzerland, email:ftf@fsfeurope.org.
47 * Handle mount request
48 * For now, we put the bsock in the UA's queue
51 /* Requests from the Storage daemon */
54 /* Responses sent to Storage daemon */
56 static char OK_mount[] = "1000 OK MountVolume\n";
59 static BQUEUE mountq = {&mountq, &mountq};
60 static int num_reqs = 0;
61 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
63 typedef struct mnt_req_s {
70 void mount_request(JCR *jcr, BSOCK *bs, char *buf)
74 mr = (MNT_REQ *) malloc(sizeof(MNT_REQ));
75 memset(mr, 0, sizeof(MNT_REQ));
80 qinsert(&mountq, &mr->bq);