[DRBD-cvs] user by phil; * Removed DRBD_IOCTL_UNCONFIG_BOTH ioctl...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Sun, 8 Feb 2004 13:26:19 +0100 (CET)


DRBD CVS committal

Author  : phil
Project : drbd
Module  : user

Dir     : drbd/user


Modified Files:
      Tag: rel-0_7-branch
	drbdsetup.c 


Log Message:
* Removed DRBD_IOCTL_UNCONFIG_BOTH ioctl()
* introduced inc_local() and dec_local() to track usage of local
  disk.
* removed state_wait. Made the remaining users use cstate_wait.
* Introduced various NegAck Packets, to handle disk failures on
  seconary nodes.

drbdsetup /dev/nbd/x detach 
drbdsetup /dev/nbd/x disk

should now be free of races. 

[Completely untested!]

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/user/drbdsetup.c,v
retrieving revision 1.54.2.20
retrieving revision 1.54.2.21
diff -u -3 -r1.54.2.20 -r1.54.2.21
--- drbdsetup.c	6 Feb 2004 15:43:55 -0000	1.54.2.20
+++ drbdsetup.c	8 Feb 2004 12:26:14 -0000	1.54.2.21
@@ -869,9 +869,7 @@
       err=errno;
       perror("ioctl() failed");
       if(err==EINPROGRESS)
-	fprintf(stderr,"Can not start resynchronisation. Already running\n");
-      if(err==ENXIO)
-	fprintf(stderr,"Can not start resynchronisation. Not connected\n");
+	fprintf(stderr,"Only in 'Connected' cstate possible.");
       return 20;
     }
   return 0;
@@ -887,9 +885,7 @@
       err=errno;
       perror("ioctl() failed");
       if(err==EINPROGRESS)
-	fprintf(stderr,"Can not start resynchronisation. Already running\n");
-      if(err==ENXIO)
-	fprintf(stderr,"Can not start resynchronisation. Not connected\n");
+	fprintf(stderr,"Only in 'Connected' cstate possible.");
       return 20;
     }
   return 0;
@@ -897,19 +893,8 @@
 
 int cmd_down(int drbd_fd,char** argv,int argc,struct option *options)
 {
-  int err;
-
-  err=ioctl(drbd_fd,DRBD_IOCTL_UNCONFIG_BOTH);
-  if(err)
-    {
-      err=errno;
-      perror("ioctl() failed");
-      if(err==ENXIO)
-	fprintf(stderr,"Device is not configured!\n");
-      if(err==EBUSY)
-	fprintf(stderr,"Someone has opened the device!\n");
-      return 20;
-    }
+  cmd_disconnect(drbd_fd,argv,argc,options);
+  cmd_detach(drbd_fd,argv,argc,options);
   return 0;
 }