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 Copyright (C) 2001-2004 Kern Sibbald and John Walker
18 This program is free software; you can redistribute it and/or
19 modify it under the terms of the GNU General Public License as
20 published by the Free Software Foundation; either version 2 of
21 the License, or (at your option) any later version.
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 General Public License for more details.
28 You should have received a copy of the GNU General Public
29 License along with this program; if not, write to the Free
30 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
39 * Handle mount request
40 * For now, we put the bsock in the UA's queue
43 /* Requests from the Storage daemon */
46 /* Responses sent to Storage daemon */
48 static char OK_mount[] = "1000 OK MountVolume\n";
51 static BQUEUE mountq = {&mountq, &mountq};
52 static int num_reqs = 0;
53 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
55 typedef struct mnt_req_s {
62 void mount_request(JCR *jcr, BSOCK *bs, char *buf)
66 mr = (MNT_REQ *) malloc(sizeof(MNT_REQ));
67 memset(mr, 0, sizeof(MNT_REQ));
72 qinsert(&mountq, &mr->bq);