[DRBD-cvs] r1491 - in trunk: drbd testing
drbd-user@lists.linbit.com
drbd-user@lists.linbit.com
Tue, 17 Aug 2004 15:44:42 +0200 (CEST)
Author: lars
Date: 2004-08-17 15:44:40 +0200 (Tue, 17 Aug 2004)
New Revision: 1491
Modified:
trunk/drbd/drbd_main.c
trunk/drbd/drbd_receiver.c
trunk/drbd/drbd_worker.c
trunk/testing/read_gc.pl
trunk/testing/write_gc.pl
Log:
linux 2.4.X does not have mm_inline.h
added MDF_FullSync to read/write gc.pl
Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c 2004-08-14 12:29:43 UTC (rev 1490)
+++ trunk/drbd/drbd_main.c 2004-08-17 13:44:40 UTC (rev 1491)
@@ -45,7 +45,9 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/mm.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/mm_inline.h>
+#endif
#include <linux/slab.h>
#include <linux/devfs_fs_kernel.h>
Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c 2004-08-14 12:29:43 UTC (rev 1490)
+++ trunk/drbd/drbd_receiver.c 2004-08-17 13:44:40 UTC (rev 1491)
@@ -39,7 +39,9 @@
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/mm.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/mm_inline.h>
+#endif
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/pkt_sched.h>
Modified: trunk/drbd/drbd_worker.c
===================================================================
--- trunk/drbd/drbd_worker.c 2004-08-14 12:29:43 UTC (rev 1490)
+++ trunk/drbd/drbd_worker.c 2004-08-17 13:44:40 UTC (rev 1491)
@@ -32,7 +32,9 @@
#include <linux/smp_lock.h>
#include <linux/wait.h>
#include <linux/mm.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/mm_inline.h> // for the page_count macro on RH/Fedora
+#endif
#include <linux/slab.h>
#include <linux/drbd.h>
Modified: trunk/testing/read_gc.pl
===================================================================
--- trunk/testing/read_gc.pl 2004-08-14 12:29:43 UTC (rev 1490)
+++ trunk/testing/read_gc.pl 2004-08-17 13:44:40 UTC (rev 1491)
@@ -42,10 +42,15 @@
die "state file corrupt" if($MagicNr != DRBD_MD_MAGIC);
- printf(" %6s | %3s | %3d | %3d | %3d | %3d | %3s | %3s | %6d KB\n",
- $resource,$Flags & 0x01 ? "1/c" : "0/i",$HumanCnt,$TimeoutCnt,
- $ConnectedCnt,$ArbitraryCnt,$Flags & 0x02 ? "1/p" : "0/s",
- $Flags & 0x04 ? "1/c" : "0/n",$size);
+ printf(" %6s | %3s | %3d | %3d | %3d | %3d | %3s | %3s | %3s | %6d KB\n",
+ $resource,
+ $Flags & 0x01 ? "1/c" : "0/i", # is consistent
+ # (may become sync source)
+ $HumanCnt, $TimeoutCnt, $ConnectedCnt, $ArbitraryCnt,
+ $Flags & 0x02 ? "1/p" : "0/s", # last state
+ $Flags & 0x04 ? "1/c" : "0/n", # was connected
+ $Flags & 0x08 ? "yes" : " no", # wants full sync
+ $size);
ioctl(GCF,BLKFLSBUF,0); # Ask the buffer cache to forget this buffer.
@@ -61,15 +66,16 @@
@resources = sort(split(' ',`drbdadm sh-resources`));
print <<EOS;
- ConnectedInd |
- lastState | |
- ArbitraryCnt | | |
- ConnectedCnt | | | |
- TimeoutCnt | | | | |
- HumanCnt | | | | | |
- Consistent | | | | | | |
-resource| | | | | | | | Size
---------+-----+-----+-----+-----+-----+-----+-----+----------+
+ WantFullSync |
+ ConnectedInd | |
+ lastState | | |
+ ArbitraryCnt | | | |
+ ConnectedCnt | | | | |
+ TimeoutCnt | | | | | |
+ HumanCnt | | | | | | |
+ Consistent | | | | | | | |
+resource| | | | | | | | | Size
+--------+-----+-----+-----+-----+-----+-----+-----+-----+----------+
EOS
for $res (@resources) {
Modified: trunk/testing/write_gc.pl
===================================================================
--- trunk/testing/write_gc.pl 2004-08-14 12:29:43 UTC (rev 1490)
+++ trunk/testing/write_gc.pl 2004-08-17 13:44:40 UTC (rev 1491)
@@ -23,7 +23,8 @@
sub write_gc_file
{
my ($md_dev,$md_index,$del_al,$Consistent,$HumanCnt,$TimeoutCnt,
- $ConnectedCnt,$ArbitraryCnt,$lastState,$ConnectedInd) = @_;
+ $ConnectedCnt,$ArbitraryCnt,$lastState,$ConnectedInd,
+ $WantFullSync) = @_;
my ($Flags,$rr,$pos,$md_start,$out);
ensure_default(\$Consistent,"Consistent",1);
@@ -33,6 +34,7 @@
ensure_default(\$ArbitraryCnt,"ArbitraryCnt",1);
ensure_default(\$lastState,"lastState",0);
ensure_default(\$ConnectedInd,"ConnectedInd",0);
+ ensure_default(\$WantFullSync,"WantFullSync",0);
sysopen (GCF,$md_dev,O_WRONLY)
or die "can not open GC file";
@@ -57,6 +59,7 @@
if($Consistent) { $Flags |= 0x01; }
if($lastState) { $Flags |= 0x02; }
if($ConnectedInd) { $Flags |= 0x04; }
+ if($WantFullSync) { $Flags |= 0x08; }
$out = pack("N6", $Flags,$HumanCnt,$TimeoutCnt,$ConnectedCnt,
$ArbitraryCnt, DRBD_MD_MAGIC);
@@ -115,4 +118,3 @@
main(@ARGV);
-