ports/68575: New release for nbd-server
Wouter Verhelst
wouter at grep.be
Fri Jul 2 01:10:57 UTC 2004
>Number: 68575
>Category: ports
>Synopsis: New release for nbd-server
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Fri Jul 02 01:10:15 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Wouter Verhelst
>Release: FreeBSD 5.2.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD worldmusic.grep.be 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Mon Feb 23 20:45:55 GMT 2004 root at wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386
>Description:
There have been a few updates after nbd-server 2.6.0, but I
haven't seen any maintainer activity on those (I might just be
too impatient, dunno ;-). Patch to update the port to the latest
nbd-server follows.
>How-To-Repeat:
>Fix:
diff -ruN nbd-server.orig/Makefile nbd-server/Makefile
--- nbd-server.orig/Makefile Sat Jun 26 10:39:58 2004
+++ nbd-server/Makefile Sat Jun 26 11:58:47 2004
@@ -6,8 +6,7 @@
#
PORTNAME= nbd-server
-PORTVERSION= 2.6.0
-PORTREVISION= 1
+PORTVERSION= 2.7.1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= nbd
@@ -16,12 +15,10 @@
MAINTAINER= xi at borderworlds.dk
COMMENT= A server for the linux network block device (nbd)
-WRKSRC= ${WRKDIR}/nbd-2.6
-
HAS_CONFIGURE= yes
PLIST_FILES= bin/nbd-server
-CONFIGURE_ARGS+= --prefix=${PREFIX}
-USE_GMAKE= yes
+BUILD_DEPENDS= docbook-to-man:${PORTSDIR}/textproc/docbook-to-man
+CONFIGURE_ARGS+= --prefix=${PREFIX} --enable-lfs --enable-syslog
post-extract:
${CP} ${FILESDIR}/nbd.h ${WRKSRC}
diff -ruN nbd-server.orig/distinfo nbd-server/distinfo
--- nbd-server.orig/distinfo Sat Jun 26 10:39:58 2004
+++ nbd-server/distinfo Sat Jun 26 10:44:10 2004
@@ -1,2 +1,2 @@
-MD5 (nbd-2.6.0.tar.gz) = 97ee3120f321628b86f5c0fe77f89255
-SIZE (nbd-2.6.0.tar.gz) = 88774
+MD5 (nbd-2.7.1.tar.gz) = 54bc2b6069e752f89974ec46f96ff547
+SIZE (nbd-2.7.1.tar.gz) = 124724
diff -ruN nbd-server.orig/files/nbd.h nbd-server/files/nbd.h
--- nbd-server.orig/files/nbd.h Sat Jun 26 10:39:58 2004
+++ nbd-server/files/nbd.h Sat Jun 26 10:45:10 2004
@@ -5,6 +5,9 @@
* 2001 Copyright (C) Steven Whitehouse
* New nbd_end_request() for compatibility with new linux block
* layer code.
+ * 2003/06/24 Louis D. Langholtz <ldl at aros.net>
+ * Removed unneeded blksize_bits field from nbd_device struct.
+ * Cleanup PARANOIA usage & code.
*/
#ifndef LINUX_NBD_H
@@ -20,58 +23,39 @@
#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
#define NBD_DISCONNECT _IO( 0xab, 8 )
-#ifdef MAJOR_NR
-
-#include <linux/locks.h>
-#include <asm/semaphore.h>
-
-#define LOCAL_END_REQUEST
-
-#include <linux/blk.h>
-
-#ifdef PARANOIA
-extern int requests_in;
-extern int requests_out;
-#endif
+enum {
+ NBD_CMD_READ = 0,
+ NBD_CMD_WRITE = 1,
+ NBD_CMD_DISC = 2
+};
-static void
-nbd_end_request(struct request *req)
-{
- struct buffer_head *bh;
- unsigned nsect;
- unsigned long flags;
- int uptodate = (req->errors == 0) ? 1 : 0;
+#define nbd_cmd(req) ((req)->cmd[0])
+#define MAX_NBD 128
-#ifdef PARANOIA
- requests_out++;
-#endif
- spin_lock_irqsave(&io_request_lock, flags);
- while((bh = req->bh) != NULL) {
- nsect = bh->b_size >> 9;
- blk_finished_io(nsect);
- req->bh = bh->b_reqnext;
- bh->b_reqnext = NULL;
- bh->b_end_io(bh, uptodate);
- }
- blkdev_release_request(req);
- spin_unlock_irqrestore(&io_request_lock, flags);
-}
+/* Define PARANOIA to include extra sanity checking code in here & driver */
+#define PARANOIA
-#define MAX_NBD 128
+/* userspace doesn't need the nbd_device structure */
+#ifdef __KERNEL__
struct nbd_device {
- int refcnt;
int flags;
int harderror; /* Code of hard error */
#define NBD_READ_ONLY 0x0001
#define NBD_WRITE_NOCHK 0x0002
struct socket * sock;
- struct file * file; /* If == NULL, device is not ready, yet */
- int magic; /* FIXME: not if debugging is off */
+ struct file * file; /* If == NULL, device is not ready, yet */
+#ifdef PARANOIA
+ int magic; /* FIXME: not if debugging is off */
+#endif
spinlock_t queue_lock;
- struct list_head queue_head; /* Requests are added here... */
+ struct list_head queue_head;/* Requests are added here... */
struct semaphore tx_lock;
+ struct gendisk *disk;
+ int blksize;
+ u64 bytesize;
};
+
#endif
/* This now IS in some kind of include file... */
diff -ruN nbd-server.orig/files/patch-include nbd-server/files/patch-include
--- nbd-server.orig/files/patch-include Sat Jun 26 10:39:58 2004
+++ nbd-server/files/patch-include Thu Jan 1 01:00:00 1970
@@ -1,11 +0,0 @@
-diff -urN nbd-2.6.orig/nbd-server.c nbd-2.6/nbd-server.c
---- nbd-2.6.orig/nbd-server.c Thu Oct 16 15:08:17 2003
-+++ nbd-server.c Sun Dec 14 23:48:10 2003
-@@ -53,6 +53,7 @@
- #include <sys/stat.h>
- #include <sys/wait.h> /* wait */
- #include <sys/ioctl.h>
-+#include <sys/param.h>
- #include <sys/mount.h> /* For BLKGETSIZE */
- #include <signal.h> /* sigaction */
- #include <netinet/tcp.h>
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list