nlm: Ensure callback code also checks that the files match
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / nbd.h
CommitLineData
1da177e4
LT
1/*
2 * 1999 Copyright (C) Pavel Machek, pavel@ucw.cz. This code is GPL.
3 * 1999/11/04 Copyright (C) 1999 VMware, Inc. (Regis "HPReg" Duchesne)
4 * Made nbd_end_request() use the io_request_lock
5 * 2001 Copyright (C) Steven Whitehouse
6 * New nbd_end_request() for compatibility with new linux block
7 * layer code.
8 * 2003/06/24 Louis D. Langholtz <ldl@aros.net>
9 * Removed unneeded blksize_bits field from nbd_device struct.
10 * Cleanup PARANOIA usage & code.
11 * 2004/02/19 Paul Clements
12 * Removed PARANOIA, plus various cleanup and comments
13 */
1da177e4
LT
14#ifndef LINUX_NBD_H
15#define LINUX_NBD_H
16
1da177e4 17
4b2f0260 18#include <linux/wait.h>
82d4dc5a 19#include <linux/mutex.h>
607ca46e 20#include <uapi/linux/nbd.h>
4b2f0260 21
4b2f0260
HX
22struct request;
23
1da177e4
LT
24struct nbd_device {
25 int flags;
26 int harderror; /* Code of hard error */
27 struct socket * sock;
28 struct file * file; /* If == NULL, device is not ready, yet */
29 int magic;
4b2f0260 30
1da177e4 31 spinlock_t queue_lock;
48cf6061 32 struct list_head queue_head; /* Requests waiting result */
4b2f0260
HX
33 struct request *active_req;
34 wait_queue_head_t active_wq;
48cf6061
LV
35 struct list_head waiting_queue; /* Requests to be sent */
36 wait_queue_head_t waiting_wq;
4b2f0260 37
82d4dc5a 38 struct mutex tx_lock;
1da177e4
LT
39 struct gendisk *disk;
40 int blksize;
41 u64 bytesize;
6b39bb65 42 pid_t pid; /* pid of nbd-client, if attached */
7fdfd406 43 int xmit_timeout;
323af551 44 int disconnect; /* a disconnect has been requested by user */
1da177e4
LT
45};
46
47#endif