ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-NBD/NBD.xs
(Generate patch)

Comparing Linux-NBD/NBD.xs (file contents):
Revision 1.3 by root, Tue Mar 8 20:19:57 2005 UTC vs.
Revision 1.5 by root, Mon Sep 20 11:14:25 2010 UTC

63 ioctl (dev, NBD_SET_BLKSIZE, blocksize); 63 ioctl (dev, NBD_SET_BLKSIZE, blocksize);
64 64
65void 65void
66_set_size (int dev, unsigned long size) 66_set_size (int dev, unsigned long size)
67 CODE: 67 CODE:
68 ioctl (dev, NBD_SET_BLKSIZE, size); 68 ioctl (dev, NBD_SET_SIZE, size);
69 69
70void 70void
71_set_size_blocks (int dev, unsigned long nblocks) 71_set_size_blocks (int dev, unsigned long nblocks)
72 CODE: 72 CODE:
73 ioctl (dev, NBD_SET_SIZE_BLOCKS, nblocks); 73 ioctl (dev, NBD_SET_SIZE_BLOCKS, nblocks);
74
75void
76_set_timeout (int dev, unsigned long timeout)
77 CODE:
78 ioctl (dev, NBD_SET_TIMEOUT, timeout);
79
80void
81_print_debug (int dev)
82 CODE:
83 ioctl (dev, NBD_PRINT_DEBUG, 0);
74 84
75MODULE = Linux::NBD PACKAGE = Linux::NBD::Server 85MODULE = Linux::NBD PACKAGE = Linux::NBD::Server
76 86
77void 87void
78_one_request (SV *obj, int fd) 88_one_request (SV *obj, int fd)
82 92
83 if (read (fd, &req, sizeof (req)) == sizeof (req)) 93 if (read (fd, &req, sizeof (req)) == sizeof (req))
84 { 94 {
85 if (req.magic == htonl (NBD_REQUEST_MAGIC)) 95 if (req.magic == htonl (NBD_REQUEST_MAGIC))
86 { 96 {
97 req.type = htonl (req.type);
98
87 if (req.type < 2) 99 if (req.type < 2)
88 { 100 {
89 u64 from = ntohll (req.from); 101 u64 from = ntohll (req.from);
90 102
91 PUSHMARK (SP); 103 PUSHMARK (SP);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines