Skip to content

Commit

Permalink
convert the wrong file format from dos to unix
Browse files Browse the repository at this point in the history
dos file format will cause many problems for git.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
  • Loading branch information
gaowanlong committed Mar 8, 2012
1 parent 46c552e commit 61037e1
Show file tree
Hide file tree
Showing 47 changed files with 3,986 additions and 3,986 deletions.
162 changes: 81 additions & 81 deletions testcases/kernel/fs/fs_maim/maimparts
@@ -1,81 +1,81 @@
#!/usr/bin/perl -w
#
# Copyright (c) International Business Machines Corp., 2000
#
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

#
# FILE(s) : maimparts
# DESCRIPTION : Takes the disk device name (ex: hda) and number of iterations
# to run thru and then rips the drive into a defined number of
# partitions ($parts). This sets up the device for partbeat
# and backbeat which are called after setup occurs.
#
# WARNING!!! : The device you specify on the command line (hda/sda/etc) will be
# blown away...smoking any important data, programs, OS, etc.
# Don't specify a device name that you don't want to wipe out.
# YOU HAVE BEEN WARNED!
#
# AUTHOR : Jeff Martin (martinjn@us.ibm.com)
# HISTORY :
#

# target is device to split into partions
$target=$ARGV[0];
$iterations=$ARGV[1];
# part is the number of partitions to split the drive into (max is 4)
$parts=3;
# fsid is the partition id or type (83 is linux native)
$fstype=$ARGV[2];
$fsid=0x83;

if (!$ARGV[0]) {
print "Usage: maimparts [target device ie: hda or sda] [iterations]\n";
exit;
}
# run sfdisk to display device geometry and rip out info
# (specifically cylinders)
$Geom = `/sbin/sfdisk -g /dev/$target`;
chomp $Geom;
($Junk,$Temp1) = split(/\: /,$Geom,2);
($Cyl,$Heads,$Sec) = split(/\, /,$Temp1,3);
($Cyl,$Junk) = split(/ /,$Cyl,2);
($Heads,$Junk) = split(/ /,$Heads,2);
($Sec,$Junk) = split(/ /,$Sec,2);

# determine partition size to create (force int so we don't
# try to use 1/2 a cylinder!)
$psize = int($Cyl/$parts);

# create a config file in /tmp for sfdisk creation run
open(CONFIG,">/tmp/part.cfg") ||
die "Couldn't create /tmp/part.cfg\n";
for($i=1;$i<=$parts;$i++) {
printf(CONFIG ",%d,%x\n",$psize,$fsid); # write the lines in cfg
}
close(CONFIG);

# create the partitions!
`sfdisk --force /dev/$target < /tmp/part.cfg`;

#run partbeat on the partitions
for ($k=1;$k<=$parts;$k++) {
$part[$k] = sprintf("%s%d",$target,$k);
$tmp = `./partbeat /dev/$target$k $iterations $fstype`;
print $tmp;
}
$tmp = `./backbeat /dev/$part[1] /dev/$part[2] /dev/$part[3]`;
print $tmp;
#!/usr/bin/perl -w
#
# Copyright (c) International Business Machines Corp., 2000
#
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

#
# FILE(s) : maimparts
# DESCRIPTION : Takes the disk device name (ex: hda) and number of iterations
# to run thru and then rips the drive into a defined number of
# partitions ($parts). This sets up the device for partbeat
# and backbeat which are called after setup occurs.
#
# WARNING!!! : The device you specify on the command line (hda/sda/etc) will be
# blown away...smoking any important data, programs, OS, etc.
# Don't specify a device name that you don't want to wipe out.
# YOU HAVE BEEN WARNED!
#
# AUTHOR : Jeff Martin (martinjn@us.ibm.com)
# HISTORY :
#

# target is device to split into partions
$target=$ARGV[0];
$iterations=$ARGV[1];
# part is the number of partitions to split the drive into (max is 4)
$parts=3;
# fsid is the partition id or type (83 is linux native)
$fstype=$ARGV[2];
$fsid=0x83;

if (!$ARGV[0]) {
print "Usage: maimparts [target device ie: hda or sda] [iterations]\n";
exit;
}
# run sfdisk to display device geometry and rip out info
# (specifically cylinders)
$Geom = `/sbin/sfdisk -g /dev/$target`;
chomp $Geom;
($Junk,$Temp1) = split(/\: /,$Geom,2);
($Cyl,$Heads,$Sec) = split(/\, /,$Temp1,3);
($Cyl,$Junk) = split(/ /,$Cyl,2);
($Heads,$Junk) = split(/ /,$Heads,2);
($Sec,$Junk) = split(/ /,$Sec,2);

# determine partition size to create (force int so we don't
# try to use 1/2 a cylinder!)
$psize = int($Cyl/$parts);

# create a config file in /tmp for sfdisk creation run
open(CONFIG,">/tmp/part.cfg") ||
die "Couldn't create /tmp/part.cfg\n";
for($i=1;$i<=$parts;$i++) {
printf(CONFIG ",%d,%x\n",$psize,$fsid); # write the lines in cfg
}
close(CONFIG);

# create the partitions!
`sfdisk --force /dev/$target < /tmp/part.cfg`;

#run partbeat on the partitions
for ($k=1;$k<=$parts;$k++) {
$part[$k] = sprintf("%s%d",$target,$k);
$tmp = `./partbeat /dev/$target$k $iterations $fstype`;
print $tmp;
}
$tmp = `./backbeat /dev/$part[1] /dev/$part[2] /dev/$part[3]`;
print $tmp;
154 changes: 77 additions & 77 deletions testcases/kernel/fs/fs_maim/partbeat
@@ -1,77 +1,77 @@
#!/usr/bin/perl -w
#
# Copyright (c) International Business Machines Corp., 2000
#
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

#
# FILE(s) : partbeat
# DESCRIPTION : Quick test to test storage management functions like mount and fsck.
# More can be added later without much trouble. Command line takes the
# partition device name (ex: /dev/hda1), an integer for how many iterations
# of the test you would like to run and the filesystem type to use (jfs or ext2 for now).
# AUTHOR : Jeff Martin (martinjn@us.ibm.com)
# HISTORY :
#

$target=$ARGV[0];
$iterations=$ARGV[1];
$fstype=$ARGV[2];

print "mkfs:";
if ($fstype =~ /jfs\b/i) {
$tmp = `mkfs.jfs -f $target`;
}
elsif ($fstype =~ /ext2\b/i) {
$tmp=`mkfs $target`;
}
elsif ($fstype =~ /ext3\b/i) {
$tmp=`mkfs -t ext3 $target`;
}
elsif ($fstype =~ /reiserfs\b/i) {
$tmp=`mkreiserfs --format 3.6 -f $target`;
}
else {
$tmp=`mkfs $target`;
}
print $tmp;

print "fsck:";
$tmp=`fsck -t $fstype -a $target`;
print $tmp;

($junk,$junk,$device)=split(/\//,$target);

`mkdir $device`;

for ($i=1;$i<=$iterations;$i++) {
print "mount:";
$tmp=`mount -t $fstype $target $device`;
print ($tmp."\n");

`touch $device/indicator$i`;

print "umount:";
$tmp=`umount $target`;
print ($tmp."\n");
}

print "fsck:";
$tmp=`fsck -t $fstype -a $target`;
print $tmp;

`mount -t $fstype $target $device`;
`rm -f $device/indicator*`;
#!/usr/bin/perl -w
#
# Copyright (c) International Business Machines Corp., 2000
#
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

#
# FILE(s) : partbeat
# DESCRIPTION : Quick test to test storage management functions like mount and fsck.
# More can be added later without much trouble. Command line takes the
# partition device name (ex: /dev/hda1), an integer for how many iterations
# of the test you would like to run and the filesystem type to use (jfs or ext2 for now).
# AUTHOR : Jeff Martin (martinjn@us.ibm.com)
# HISTORY :
#

$target=$ARGV[0];
$iterations=$ARGV[1];
$fstype=$ARGV[2];

print "mkfs:";
if ($fstype =~ /jfs\b/i) {
$tmp = `mkfs.jfs -f $target`;
}
elsif ($fstype =~ /ext2\b/i) {
$tmp=`mkfs $target`;
}
elsif ($fstype =~ /ext3\b/i) {
$tmp=`mkfs -t ext3 $target`;
}
elsif ($fstype =~ /reiserfs\b/i) {
$tmp=`mkreiserfs --format 3.6 -f $target`;
}
else {
$tmp=`mkfs $target`;
}
print $tmp;

print "fsck:";
$tmp=`fsck -t $fstype -a $target`;
print $tmp;

($junk,$junk,$device)=split(/\//,$target);

`mkdir $device`;

for ($i=1;$i<=$iterations;$i++) {
print "mount:";
$tmp=`mount -t $fstype $target $device`;
print ($tmp."\n");

`touch $device/indicator$i`;

print "umount:";
$tmp=`umount $target`;
print ($tmp."\n");
}

print "fsck:";
$tmp=`fsck -t $fstype -a $target`;
print $tmp;

`mount -t $fstype $target $device`;
`rm -f $device/indicator*`;

0 comments on commit 61037e1

Please sign in to comment.