[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Nbd] [NBD]nbd_device structure



Hi List,

This is the nbd device structure

struct nbd_device {
	int flags;
	int harderror;		/* Code of hard error			*/
	struct socket * sock;
	struct file * file; 	/* If == NULL, device is not ready, yet	*/
	int magic;

        spinlock_t queue_lock;
        struct list_head queue_head;    /* Requests waiting result */
        struct request *active_req;
        wait_queue_head_t active_wq;
        struct list_head waiting_queue; /* Requests to be sent */
        wait_queue_head_t waiting_wq;

	struct mutex tx_lock;
	struct gendisk *disk;
	int blksize;
	u64 bytesize;
	pid_t pid; /* pid of nbd-client, if attached */
	int xmit_timeout;
};

Can anyone tell me the exact meaning of each filed in this structure?
Especially for the fileds of following ones.
...
       spinlock_t queue_lock;
        struct list_head queue_head;    /* Requests waiting result */
        struct request *active_req;
        wait_queue_head_t active_wq;
        struct list_head waiting_queue; /* Requests to be sent */
        wait_queue_head_t waiting_wq;
...

What are their interactions with each other? What do they act in nbd module?




-- 
Thanks
Harry Wei



Reply to: