r23779: Change from v2 or later to v3 or later.
[kai/samba-autobuild/.git] / source / torture / locktest2.c
index 519acebe8e81413621b1b66a69139aa78ce6d00e..e8d3abe4789d7c476eaa7478d2a46a973a4522e0 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -29,6 +29,9 @@ static BOOL analyze;
 static BOOL hide_unlock_fails;
 static BOOL use_oplocks;
 
+extern char *optarg;
+extern int optind;
+
 #define FILENAME "\\locktest.dat"
 #define LOCKRANGE 100
 #define LOCKBASE 0
@@ -133,12 +136,14 @@ static BOOL try_unlock(struct cli_state *c, int fstype,
        return False;
 }      
 
-static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, 
+static void print_brl(struct file_id id, struct server_id pid, 
                      enum brl_type lock_type,
-                     br_off start, br_off size)
+                     enum brl_flavour lock_flav,
+                     br_off start, br_off size,
+                     void *private_data)
 {
-       printf("%6d   %05x:%05x    %s  %.0f:%.0f(%.0f)\n", 
-              (int)procid_to_pid(&pid), (int)dev, (int)ino, 
+       printf("%6d   %s    %s  %.0f:%.0f(%.0f)\n", 
+              (int)procid_to_pid(&pid), file_id_static_string(&id),
               lock_type==READ_LOCK?"R":"W",
               (double)start, (double)start+size-1,(double)size);
 
@@ -255,7 +260,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
                               op==READ_LOCK?"READ_LOCK":"WRITE_LOCK",
                               ret[0], ret[1]);
                }
-               if (showall) brl_forall(print_brl);
+               if (showall) brl_forall(print_brl, NULL);
                if (ret[0] != ret[1]) return False;
        } else if (r2 < LOCK_PCT+UNLOCK_PCT) {
                /* unset a lock */
@@ -270,7 +275,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
                               start, start+len-1, len,
                               ret[0], ret[1]);
                }
-               if (showall) brl_forall(print_brl);
+               if (showall) brl_forall(print_brl, NULL);
                if (!hide_unlock_fails && ret[0] != ret[1]) return False;
        } else {
                /* reopen the file */
@@ -286,7 +291,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
                if (showall) {
                        printf("reopen conn=%u fstype=%u f=%u\n",
                               conn, fstype, f);
-                       brl_forall(print_brl);
+                       brl_forall(print_brl, NULL);
                }
        }
        return True;
@@ -470,8 +475,6 @@ static void usage(void)
  int main(int argc,char *argv[])
 {
        char *share1, *share2, *nfspath1, *nfspath2;
-       extern char *optarg;
-       extern int optind;
        int opt;
        char *p;
        int seed;