From 04a4b87dd913eeec1c5be069d0fc14c0ca66182d Mon Sep 17 00:00:00 2001 From: pschwan Date: Mon, 20 Jan 2003 01:46:15 +0000 Subject: [PATCH] merge b_intent into b_md ** You will need to upgrade to kernel version 7 ** Notes: - Most intent operations were removed, in favour of a so-called "RPC mode" that does a single RPC to the server and returns the rc immediately, bypassing most of the VFS. IT_OPEN and IT_LOOKUP remain pretty much unchanged. - all LDLM resource ID arrays were removed in favour of struct ldlm_res_id - aggressively cancel local locks on a lock server, such as those that the MDS requests from its own DLM - because unlink is now done with an RPC-mode call, there is no local inode to call delete_inode on, so the OST objects would never get unlinked. Instead, the MDS notifies the client that it was the last unlink, along with the lsm, which it uses to free the OST objects - mds_reint_rename, mds_reint_unlink, and mds_reint_link were rewritten to use enqueue_ordered_locks and avoid lock-ordering deadlocks - recursive symlinks were fixed - fixed NULL deref in DEBUG_REQ - filter_update_lastobjid no longer calls sync, which is unnecessary when called inside a transaction (harmful, in fact) and was making extN very, very sad --- lustre/tests/rename.pl | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 lustre/tests/rename.pl diff --git a/lustre/tests/rename.pl b/lustre/tests/rename.pl new file mode 100644 index 0000000..a84787a --- /dev/null +++ b/lustre/tests/rename.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl +use strict; +use diagnostics; +use Getopt::Long; + +sub usage () { + print "Usage: $0 \n"; + print "example: $0 --count=2 /mnt/lustre 2 50\n"; + print " will test in /mnt/lustre1 and /mnt/lustre2\n"; + print " $0 --count=0 /mnt/lustre 50\n"; + print " will test in /mnt/lustre only\n"; + exit; +} +my ($j, $k, $d, $f1, $f2, $path, $count, $silent); +my $create = 0; + +GetOptions("silent!"=> \$silent, + "count=i" => \$count, + "create=i" => \$create); + +my $mtpt = shift || usage(); +my $i = shift || usage(); +my $files = 6; +my $dirs = 3; +my $mcreate = 0; # should we use mcreate or open? + +my $which = ""; +if ($count > 0) { + $which = int(rand() * $count) + 1; +} + +$k = $dirs; +if ($create == 0) { + $k = 0; +} +while ($k--) { + $path = "$mtpt$which/$k"; + mkdir $path, 0755; + $j = $files; + while ($j--) { + `./mcreate $path/$j` + } +} + + +while ($i--) { + my $which = ""; + if ($count > 0) { + $which = int(rand() * $count) + 1; + } + $d = int(rand() * $dirs); + $f1 = int(rand() * $files); + $f2 = int(rand() * $files); + print "[$$] $mtpt$which/$d/$f1 $mtpt$which/$d/$f2 ...\n"; + rename "$mtpt$which/$d/$f1", "$mtpt$which/$d/$f2"; + print "[$$] done\n" if !$silent; + +} +print "Done.\n"; -- 1.8.3.1