fstests: remove DMAPI tests

Upstream XFS has never supported DMAPI, so remove the tests for this
feature.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2021-02-11 13:33:38 -08:00
committed by Eryu Guan
parent 0ea70dceec
commit 6497ede7ad
183 changed files with 2 additions and 28154 deletions
-79
View File
@@ -178,85 +178,6 @@
/src/log-writes/replay-log
/src/perf/*.pyc
# dmapi/ binaries
/dmapi/src/common/cmd/read_invis
/dmapi/src/common/cmd/set_region
/dmapi/src/common/cmd/set_return_on_destroy
/dmapi/src/common/cmd/write_invis
/dmapi/src/sample_hsm/migfind
/dmapi/src/sample_hsm/migin
/dmapi/src/sample_hsm/migout
/dmapi/src/sample_hsm/mls
/dmapi/src/sample_hsm/mrmean
/dmapi/src/sample_hsm/wbee
/dmapi/src/simple/dm_create_session
/dmapi/src/simple/dm_destroy_session
/dmapi/src/simple/dm_find_eventmsg
/dmapi/src/simple/dm_getall_sessions
/dmapi/src/simple/dm_getall_tokens
/dmapi/src/simple/dm_query_session
/dmapi/src/suite1/cmd/create_userevent
/dmapi/src/suite1/cmd/dm_handle
/dmapi/src/suite1/cmd/downgrade_right
/dmapi/src/suite1/cmd/fd_to_handle
/dmapi/src/suite1/cmd/get_allocinfo
/dmapi/src/suite1/cmd/get_config_events
/dmapi/src/suite1/cmd/get_dirattrs
/dmapi/src/suite1/cmd/get_dmattr
/dmapi/src/suite1/cmd/get_eventlist
/dmapi/src/suite1/cmd/get_events
/dmapi/src/suite1/cmd/get_fileattr
/dmapi/src/suite1/cmd/get_mountinfo
/dmapi/src/suite1/cmd/get_region
/dmapi/src/suite1/cmd/getall_disp
/dmapi/src/suite1/cmd/getall_dmattr
/dmapi/src/suite1/cmd/handle_to_fshandle
/dmapi/src/suite1/cmd/handle_to_path
/dmapi/src/suite1/cmd/init_service
/dmapi/src/suite1/cmd/link_test
/dmapi/src/suite1/cmd/make_sparse
/dmapi/src/suite1/cmd/obj_ref_hold
/dmapi/src/suite1/cmd/obj_ref_query
/dmapi/src/suite1/cmd/obj_ref_rele
/dmapi/src/suite1/cmd/path_to_fshandle
/dmapi/src/suite1/cmd/path_to_handle
/dmapi/src/suite1/cmd/pending
/dmapi/src/suite1/cmd/print_event
/dmapi/src/suite1/cmd/print_fshandle
/dmapi/src/suite1/cmd/probe_hole
/dmapi/src/suite1/cmd/probe_punch_xfsctl_hole
/dmapi/src/suite1/cmd/punch_hole
/dmapi/src/suite1/cmd/query_right
/dmapi/src/suite1/cmd/randomize_file
/dmapi/src/suite1/cmd/release_right
/dmapi/src/suite1/cmd/remove_dmattr
/dmapi/src/suite1/cmd/request_right
/dmapi/src/suite1/cmd/respond_event
/dmapi/src/suite1/cmd/rwt
/dmapi/src/suite1/cmd/set_disp
/dmapi/src/suite1/cmd/set_dmattr
/dmapi/src/suite1/cmd/set_eventlist
/dmapi/src/suite1/cmd/set_fileattr
/dmapi/src/suite1/cmd/struct_test
/dmapi/src/suite1/cmd/sync_by_handle
/dmapi/src/suite1/cmd/test_assumption
/dmapi/src/suite1/cmd/upgrade_right
/dmapi/src/suite2/src/dm_test_daemon
/dmapi/src/suite2/src/invis_test
/dmapi/src/suite2/src/mmap
/dmapi/src/suite2/src/region_test
/dmapi/src/suite2/src/send_msg
/dmapi/src/suite2/src/test_bulkall
/dmapi/src/suite2/src/test_bulkattr
/dmapi/src/suite2/src/test_dmattr
/dmapi/src/suite2/src/test_efault
/dmapi/src/suite2/src/test_eventlist
/dmapi/src/suite2/src/test_fileattr
/dmapi/src/suite2/src/test_hole
/dmapi/src/suite2/src/test_invis
/dmapi/src/suite2/src/test_region
/dmapi/src/suite2/src/test_rights
# Symlinked files
/tests/generic/035.out
/tests/generic/050.out
-3
View File
@@ -39,9 +39,6 @@ endif
LIB_SUBDIRS = include lib
TOOL_SUBDIRS = ltp src m4 common
ifeq ($(HAVE_DMAPI), true)
TOOL_SUBDIRS += dmapi
endif
export TESTS_DIR = tests
SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
-31
View File
@@ -1,31 +0,0 @@
##/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
#
# dmapi functions
# Commands relitive to dmapi qa
DMAPI_QASUITE1_DIR=$here/dmapi/src/suite1/
DMAPI_QASUITE2_DIR=$here/dmapi/src/suite2/
DMAPI_COMMON_DIR=$here/dmapi/src/common/
DMAPI_LS_TO_COPY_PATH=$DMAPI_QASUITE2_DIR/bindir/ls_to_copy
_dmapi_scratch_mount () {
if [ `echo "$MOUNT_OPTIONS" | grep -c dmapi` -gt 0 -o \
`echo "$MOUNT_OPTIONS" | grep -c dmi` -gt 0 ] ; then
#already got dmapi options set
_try_scratch_mount
dmapi_mount_result=$?
else
_try_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
dmapi_mount_result=$?
fi
if [ $dmapi_mount_result -ne 0 ] ; then
_notrun "Assuming DMAPI modules are not loaded"
fi
}
-106
View File
@@ -4,9 +4,6 @@
#
# common functions for excersizing hole punches with extent size hints etc.
# source dmap_scratch_mount etc.
. ./common/dmapi
_spawn_test_file() {
echo "# spawning test file with $*"
local blksize=$1
@@ -39,28 +36,6 @@ _spawn_test_file() {
fi
}
_do_punch() {
echo "# punching with $*"
# punch or bite the ear off $test_file to create a hole
local blksize=$1
local punch_offset=`expr $2 \* $blksize`
local punch_size=`expr $3 \* $blksize`
local punch_type=$4 # u for unresvsp, d for dm_punch
local test_file=$5
if [ "$punch_type" == "u" ]; then
echo "+ hole punch using unresvsp"
$XFS_IO_PROG -f \
-c "unresvsp $punch_offset $punch_size" \
$test_file
fi
if [ "$punch_type" == "d" ]; then
echo "+ hole punch using dmapi punch_hole"
${DMAPI_QASUITE1_DIR}cmd/punch_hole -o $punch_offset -l $punch_size \
${SCRATCH_MNT}/$test_file
fi
}
_do_write() {
echo "# writing with $*"
local blksize=$1
@@ -82,87 +57,6 @@ _do_bmap() {
$test_file
}
_test_punch() {
echo "# testing $* ..."
local blksize=$1
# all points and sizes below are in terms of filesystem blocks
local extsize_hint_blks=$2 # extent size hint in FS blocks, 0=do not set
local file_size_blks=$3 # the file size in blocks
local punch_points_blks=( $4 ) # array of places to punch holes in the file
local punch_sizes_blks=( $5 ) # array of size of each punch in blocks
local punch_types=( $6 ) # array of u=unresvsp or d=dm_punch
local write_points_blks=( $7 ) # array of places to pwrite in the file
local write_sizes_blks=( $8 ) # array of size of each write
local punch_write_order=( $9 ) # array of punch/write operation order
# e.g. "w p w w p" means: do 1st write...
# then 1st punch, 2nd & 3rd write, 2nd punch
local resvsp=${10} # if "noresv" then don't resvsp on file create
local filename=punch_test_file
cd /
_scratch_unmount >/dev/null 2>&1
_scratch_mkfs_xfs -bsize=$blksize >/dev/null 2>&1 \
|| _fail "mkfs failed"
local this_punch_type=""
local dmap_punch_used=0
for this_punch_type in "${punch_types[@]}"; do
[ "$this_punch_type" == "d" ] && dmap_punch_used=1
done
if [ $dmap_punch_used -ne 0 ]; then
# a punch type of dm_punch has been specified, do a dmapi mount
echo "+ mounting with dmapi enabled"
_dmapi_scratch_mount
else
# only unresvsp punch type is used, just do a normal mount
_scratch_mount
fi
cd $SCRATCH_MNT
# check a size is specified for each punch
[ ${#punch_points_blks[*]} -eq ${#punch_sizes_blks[*]} ] \
|| _fail "num punch points given does not equal num punch sizes"
# check a type is specified for each punch
[ ${#punch_points_blks[*]} -eq ${#punch_types[*]} ] \
|| _fail "num punch points given does not equal num punch types"
# check a size is specified for each write
[ ${#write_points_blks[*]} -eq ${#write_sizes_blks[*]} ] \
|| _fail "num write points given does not equal num write sizes"
# check punch_write_order operations match number of punches + writes
local total_pw_operations=`expr ${#punch_points_blks[*]} + ${#write_points_blks[*]}`
[ $total_pw_operations -eq ${#punch_write_order[*]} ] \
|| _fail "punch_write_order ops doesn't match number of punches + writes"
# create the file and setup extent size hint
_spawn_test_file $blksize $file_size_blks $extsize_hint_blks $filename $resvsp
# do the writes and punches
local operation=""
local punch_index=0
local write_index=0
for operation in "${punch_write_order[@]}"; do
if [ "$operation" == "p" ]; then
_do_punch $blksize ${punch_points_blks[$punch_index]} \
${punch_sizes_blks[$punch_index]} ${punch_types[$punch_index]} \
$filename
punch_index=`expr $punch_index + 1`
fi
if [ "$operation" == "w" ]; then
_do_write $blksize ${write_points_blks[$write_index]} \
${write_sizes_blks[$write_index]} $filename
write_index=`expr $write_index + 1`
fi
sync
_do_bmap $filename # print out the state of the file
done
}
_coalesce_extents()
{
block_size=$1
+2 -2
View File
@@ -281,8 +281,8 @@ _mount_ops_filter()
[ $last_index -gt 0 ] && shift $last_index
local fs_escaped=$1
echo $params | sed -e 's/dmapi/dmi/' \
| $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$fs_escaped\1\2#; print;"
echo $params | \
$PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$fs_escaped\1\2#; print;"
}
-16
View File
@@ -1,16 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (C) 2011 SGI All Rights Reserved.
#
#
#
TOPDIR = ..
include $(TOPDIR)/include/builddefs
SUBDIRS = src
default: $(SUBDIRS)
include $(BUILDRULES)
install: default
-6
View File
@@ -1,6 +0,0 @@
The tests in this directory are a collection of suites that were developed
over the time the DMAPI spec was being created and when DMAPI was being
implemented on Irix. In many cases, each suite was built on an earlier suite.
Many of these tests have been ported to work with XFS/DMAPI on linux 2.4; many
are untouched from their Irix versions.
-21
View File
@@ -1,21 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (C) 2011 SGI All Rights Reserved.
#
#
#
TOPDIR = ../..
include $(TOPDIR)/include/builddefs
LIB_SUBDIRS = common
TOOL_SUBDIRS = sample_hsm simple suite1 suite2
SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
default: $(SUBDIRS)
$(TOOL_SUBDIRS): $(LIB_SUBDIRS)
include $(BUILDRULES)
install: default
-23
View File
@@ -1,23 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (C) 2011 SGI All Rights Reserved.
#
#
#
TOPDIR = ../../..
include $(TOPDIR)/include/builddefs
LIB_SUBDIRS = lib
TOOL_SUBDIRS = cmd
SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
default: $(SUBDIRS)
$(TOOL_SUBDIRS): $(LIB_SUBDIRS)
include $(BUILDRULES)
install: default
install-dev:
-31
View File
@@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (C) 2011 SGI All Rights Reserved.
#
#
#
TOPDIR = ../../../..
include $(TOPDIR)/include/builddefs
TARGETS = read_invis set_region set_return_on_destroy write_invis
CFILES = $(TARGETS:=.c)
LDIRT = $(TARGETS)
CFLAGS += -I.. -I/usr/include/xfs
LLDLIBS = $(TOPDIR)/dmapi/src/common/lib/libdmtest.la $(LIBDM)
default: depend $(TARGETS)
depend: .dep
include $(BUILDRULES)
install install-dev: default
$(TARGETS):
@echo " [CC] $@"
$(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
-include .dep
-196
View File
@@ -1,196 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2001 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <ctype.h>
#include <lib/hsm.h>
#include <string.h>
#include <malloc.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
/*---------------------------------------------------------------------------
Test program used to test the DMAPI function dm_read_invis(). The
command line is:
read_invis [-o offset] [-l length] [-s sid] [-c char] \
[-S storefile] {pathname|handle}
where:
'offset' is the offset of the start of the write (0 is the default),
'length' is the length of the write in bytes (1 is the default),
'sid' is the session ID whose events you you are interested in.
'pathname' is the name of the file to be written.
'char' is ignored--it just allows read_invis and write_invis to have
interchangeable commandlines without having to fuss with the params.
----------------------------------------------------------------------------*/
#ifndef linux
extern char *sys_errlist[];
#endif
extern int optind;
extern char *optarg;
char *Progname;
static void
usage(void)
{
fprintf(stderr, "usage:\t%s [-o offset] [-l length] "
"[-s sid] [-c char] "
"[-S storefile] {pathname|handle}\n", Progname);
exit(1);
}
int
main(
int argc,
char **argv)
{
dm_sessid_t sid = DM_NO_SESSION;
char *object = NULL;
dm_off_t offset = 0;
long long lltemp;
dm_size_t length = 1;
unsigned long long ulltemp;
char *bufp = NULL;
void *hanp;
size_t hlen;
dm_ssize_t rc;
char *name;
int opt;
int i;
char *storefile = NULL;
int storefd = 0;
int exit_status = 0;
Progname = strrchr(argv[0], '/');
if (Progname) {
Progname++;
} else {
Progname = argv[0];
}
/* Crack and validate the command line options. */
while ((opt = getopt(argc, argv, "o:l:s:c:S:")) != EOF) {
switch (opt) {
case 'o':
sscanf(optarg, "%lld", &lltemp);
offset = (dm_off_t) lltemp;
break;
case 'l':
sscanf(optarg, "%llu", &ulltemp);
length = (dm_size_t) ulltemp;
break;
case 's':
sid = atol(optarg);
break;
case 'c':
/* This is a no-op, it just allows read_invis
* and write_invis to have interchangeable
* commandlines, without having to fuss with
* the params.
*/
break;
case 'S':
storefile = optarg;
break;
case '?':
usage();
}
}
if (optind + 1 != argc)
usage();
object = argv[optind];
if (dm_init_service(&name) == -1) {
fprintf(stderr, "Can't initialize the DMAPI\n");
exit(1);
}
if (sid == DM_NO_SESSION)
find_test_session(&sid);
/* Get the file's handle. */
if (opaque_to_handle(object, &hanp, &hlen)) {
fprintf(stderr, "can't get handle for %s\n", object);
exit(1);
}
if (length > 0) {
/* In case it is a realtime file, align the buffer on a
sufficiently big boundary.
*/
if ((bufp = memalign(4096, length)) == NULL) {
fprintf(stderr, "malloc of %llu bytes failed\n",
(unsigned long long) length);
exit(1);
}
memset(bufp, '\0', length);
}
if (storefile) {
off_t lret;
if ((storefd = open(storefile, O_WRONLY|O_CREAT, 0777)) == -1) {
fprintf(stderr, "unable to open store file for write (%s), errno = %d\n", storefile, errno);
exit(1);
}
lret = lseek(storefd, offset, SEEK_SET);
if (lret < 0) {
fprintf(stderr, "unable to lseek(%s) to offset %lld, errno = %d\n",
storefile, (long long)lret, errno);
exit(1);
}
}
rc = dm_read_invis(sid, hanp, hlen, DM_NO_TOKEN, offset, length, bufp);
if (rc < 0) {
fprintf(stderr, "dm_read_invis failed, %s\n", strerror(errno));
exit_status++;
} else if (rc != length) {
fprintf(stderr, "dm_read_invis expected to read %llu bytes, actually "
"read %lld\n", (unsigned long long) length,
(long long) rc);
exit_status++;
}
if (storefile) {
ssize_t sret;
sret = write(storefd, bufp, rc);
if (sret < 0) {
fprintf(stderr, "unable to write to store file (%s), errno = %d\n", storefile, errno);
exit_status++;
}
else if (sret != rc) {
fprintf(stderr, "write(%s) returned %lld, expected %lld\n",
storefile, (long long)sret, (long long)rc);
exit_status++;
}
close(storefd);
}
else {
for (i = 0; i < rc; i++) {
if (isprint(bufp[i])) {
fprintf(stdout, "%c", bufp[i]);
} else {
fprintf(stdout, "\\%03d", bufp[i]);
}
}
}
dm_handle_free(hanp, hlen);
exit(exit_status);
}
-148
View File
@@ -1,148 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2001 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <lib/hsm.h>
#include <string.h>
#include <getopt.h>
/*---------------------------------------------------------------------------
Test program used to test the DMAPI function dm_set_region(). The
command line is:
set_region [-n nelem] [-o offset] [-l length] [-s sid] {pathname|handle} [event...]
where pathname is the name of a file, nelem is the number of regions to pass
in the call, offset is the offset of the start of
the managed region, and length is the length. sid is the session ID whose
events you you are interested in, and event is zero or more managed region
events to set.
----------------------------------------------------------------------------*/
#ifndef linux
extern char *sys_errlist[];
#endif
extern int optind;
extern char *optarg;
char *Progname;
static struct {
char *name;
int value;
} rg_events[3] = {
{ "DM_REGION_READ", DM_REGION_READ },
{ "DM_REGION_WRITE", DM_REGION_WRITE },
{ "DM_REGION_TRUNCATE", DM_REGION_TRUNCATE }
};
static int nevents = sizeof(rg_events)/sizeof(rg_events[0]);
static void
usage(void)
{
int i;
fprintf(stderr, "usage:\t%s [-n nelem] [-o offset] [-l length] "
"[-s sid] {pathname|handle} [event...]\n", Progname);
fprintf(stderr, "possible events are:\n");
for (i = 0; i < nevents; i++)
fprintf(stderr, "%s (0x%x)\n", rg_events[i].name, rg_events[i].value);
exit(1);
}
int
main(
int argc,
char **argv)
{
dm_region_t region = { 0, 0, 0 };
dm_sessid_t sid = DM_NO_SESSION;
char *object = NULL;
u_int exactflag;
u_int nelem = 1;
void *hanp;
size_t hlen;
char *name;
int opt;
int i;
Progname = strrchr(argv[0], '/');
if (Progname) {
Progname++;
} else {
Progname = argv[0];
}
/* Crack and validate the command line options. */
while ((opt = getopt(argc, argv, "n:o:l:s:")) != EOF) {
switch (opt) {
case 'n':
nelem = atol(optarg);
break;
case 'o':
region.rg_offset = atol(optarg);
break;
case 'l':
region.rg_size = atol(optarg);
break;
case 's':
sid = atol(optarg);
break;
case '?':
usage();
}
}
if (optind + 1 > argc)
usage();
object = argv[optind++];
if (dm_init_service(&name) == -1) {
fprintf(stderr, "Can't initialize the DMAPI\n");
exit(1);
}
if (sid == DM_NO_SESSION)
find_test_session(&sid);
/* Get the file's handle. */
if (opaque_to_handle(object, &hanp, &hlen)) {
fprintf(stderr, "can't get handle for %s\n", object);
exit(1);
}
for (; optind < argc; optind++) {
if (strspn(argv[optind], "0123456789") == strlen(argv[optind])){
region.rg_flags |= atol(argv[optind]);
continue;
}
for (i = 0; i < nevents; i++) {
if (!strcmp(argv[optind], rg_events[i].name))
break;
}
if (i == nevents) {
fprintf(stderr, "invalid event %s\n", argv[optind]);
exit(1);
}
region.rg_flags |= rg_events[i].value;
}
if (dm_set_region(sid, hanp, hlen, DM_NO_TOKEN, nelem, &region,
&exactflag)) {
fprintf(stderr, "dm_set_region failed, %s\n",
strerror(errno));
exit(1);
}
fprintf(stdout, "exactflag is %s\n",
exactflag == DM_TRUE ? "True" : "False");
dm_handle_free(hanp, hlen);
exit(0);
}
@@ -1,130 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2002 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <lib/hsm.h>
#include <string.h>
#include <getopt.h>
/*---------------------------------------------------------------------------
Test program used to test the DMAPI function dm_set_return_on_destroy(). The
command line is:
set_return_on_destroy [-F] [-s sid] [-t token] {pathname|fshandle} [attr]
where pathname is the name of a file which resides in the filesystem of
interest. attr is the name of the DMAPI attribute; if none is specified,
then set-return-on-destroy will be disabled for the filesystem.
sid is the session ID whose attribute you are interested in setting.
Use -F if you want the program to find the fshandle based on the pathname.
----------------------------------------------------------------------------*/
#ifndef linux
extern char *sys_errlist[];
#endif
extern int optind;
extern char *optarg;
char *Progname;
static void
usage(void)
{
fprintf(stderr, "usage:\t%s [-F] [-s sid] [-t token] {pathname|fshandle} [attr]\n", Progname);
exit(1);
}
int
main(
int argc,
char **argv)
{
dm_sessid_t sid = DM_NO_SESSION;
dm_token_t token = DM_NO_TOKEN;
char *pathname;
dm_attrname_t *attrnamep = NULL;
dm_boolean_t enable = DM_FALSE;
void *hanp;
size_t hlen;
char *name;
int opt;
int Fflag = 0;
Progname = strrchr(argv[0], '/');
if (Progname) {
Progname++;
} else {
Progname = argv[0];
}
/* Crack and validate the command line options. */
while ((opt = getopt(argc, argv, "Fs:t:")) != EOF) {
switch (opt) {
case 's':
sid = atol(optarg);
break;
case 't':
token = atol(optarg);
break;
case 'F':
Fflag++;
break;
case '?':
usage();
}
}
if (optind == argc || optind + 2 < argc)
usage();
pathname = argv[optind++];
if (optind < argc) {
enable = DM_TRUE;
attrnamep = (dm_attrname_t *)argv[optind++];
}
if (dm_init_service(&name) == -1) {
fprintf(stderr, "Can't initialize the DMAPI\n");
exit(1);
}
if (sid == DM_NO_SESSION)
find_test_session(&sid);
if (opaque_to_handle(pathname, &hanp, &hlen)) {
fprintf(stderr, "can't get handle for %s\n", pathname);
exit(1);
}
/* Get the file's handle. */
if (Fflag) {
void *fshanp;
size_t fshlen;
if (dm_handle_to_fshandle(hanp, hlen, &fshanp, &fshlen)) {
fprintf(stderr, "can't get filesystem handle for file %s, %s\n",
pathname, strerror(errno));
exit(1);
}
dm_handle_free(hanp, hlen);
hanp = fshanp;
hlen = fshlen;
}
if (dm_set_return_on_destroy(sid, hanp, hlen, token,
attrnamep, enable)) {
fprintf(stderr, "dm_set_return_on_destroy failed, %s\n",
strerror(errno));
exit(1);
}
dm_handle_free(hanp, hlen);
exit(0);
}
-175
View File
@@ -1,175 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2001 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <lib/hsm.h>
#include <unistd.h>
#include <string.h>
#include <malloc.h>
#include <getopt.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
/*---------------------------------------------------------------------------
Test program used to test the DMAPI function dm_write_invis(). The
command line is:
write_invis [-c char] [-o offset] [-l length] [-s sid] \
[-S storefile] {pathname|handle}
where:
'char' is the character to use as a repeated pattern ('X' is the default),
'offset' is the offset of the start of the write (0 is the default),
'length' is the length of the write in bytes (1 is the default),
'sid' is the session ID whose events you you are interested in.
'pathname' is the name of the file to be written.
DM_WRITE_SYNC is is not supported.
----------------------------------------------------------------------------*/
#ifndef linux
extern char *sys_errlist[];
#endif
extern int optind;
extern char *optarg;
char *Progname;
static void
usage(void)
{
fprintf(stderr, "usage:\t%s [-c char] [-o offset] [-l length] "
"[-s sid] [-S storefile] {pathname|handle}\n", Progname);
exit(1);
}
int
main(
int argc,
char **argv)
{
dm_sessid_t sid = DM_NO_SESSION;
char *object = NULL;
dm_off_t offset = 0;
long long lltemp;
dm_size_t length = 1;
unsigned long long ulltemp;
u_char ch = 'X';
void *bufp = NULL;
void *hanp;
size_t hlen;
dm_ssize_t rc;
char *name;
int opt;
char *storefile = NULL;
int storefd;
int exit_status = 0;
Progname = strrchr(argv[0], '/');
if (Progname) {
Progname++;
} else {
Progname = argv[0];
}
/* Crack and validate the command line options. */
while ((opt = getopt(argc, argv, "c:o:l:s:S:")) != EOF) {
switch (opt) {
case 'c':
ch = *optarg;
break;
case 'o':
sscanf(optarg, "%lld", &lltemp);
offset = (dm_off_t) offset;
break;
case 'l':
sscanf(optarg, "%llu", &ulltemp);
length = (dm_size_t) ulltemp;
break;
case 's':
sid = atol(optarg);
break;
case 'S':
storefile = optarg;
break;
case '?':
usage();
}
}
if (optind + 1 != argc)
usage();
object = argv[optind];
if (dm_init_service(&name) == -1) {
fprintf(stderr, "Can't initialize the DMAPI\n");
exit(1);
}
if (sid == DM_NO_SESSION)
find_test_session(&sid);
/* Get the file's handle. */
if (opaque_to_handle(object, &hanp, &hlen)) {
fprintf(stderr, "can't get handle for %s\n", object);
exit(1);
}
if (length > 0) {
/* In case it is a realtime file, align the buffer on a
sufficiently big boundary.
*/
if ((bufp = memalign(4096, length)) == NULL) {
fprintf(stderr, "malloc of %llu bytes failed\n",
(unsigned long long) length);
exit(1);
}
memset(bufp, ch, length);
}
if (storefile) {
ssize_t sret;
size_t len;
if ((storefd = open(storefile, O_RDONLY)) == -1) {
fprintf(stderr, "unable to open store file for read (%s), errno = %d\n", storefile, errno);
exit(1);
}
len = length;
sret = read(storefd, bufp, len);
if (sret < 0) {
fprintf(stderr, "unable to read store file (%s), errno = %d\n", storefile, errno);
exit(1);
}
else if (sret != length) {
fprintf(stderr, "read(%s) returned %lld, expected %lld\n",
storefile, (long long)sret, (long long)length);
exit(1);
}
close(storefd);
}
rc = dm_write_invis(sid, hanp, hlen, DM_NO_TOKEN, 0, offset, length, bufp);
if (rc < 0) {
fprintf(stderr, "dm_write_invis failed, %s\n", strerror(errno));
exit_status++;
} else if (rc != length) {
fprintf(stderr, "dm_write_invis expected to write %llu bytes, "
"actually wrote %lld\n",
(unsigned long long) length, (long long)rc);
exit_status++;
}
dm_handle_free(hanp, hlen);
exit(exit_status);
}
-31
View File
@@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (C) 2011 SGI All Rights Reserved.
#
#
#
TOPDIR = ../../../..
include $(TOPDIR)/include/builddefs
LTLIBRARY = libdmtest.la
LTLDFLAGS = -static
LT_CURRENT = 1
LT_REVISION = 0
LT_AGE = 0
CFILES = find_session.c print.c stubs.c util.c
HFILES = hsm.h dmport.h
CFLAGS += -I$(TOPDIR)/dmapi/src/common -I/usr/include/xfs
default: depend $(LTLIBRARY)
depend: .ltdep
include $(BUILDRULES)
install install-dev: default
-include .ltdep
File diff suppressed because it is too large Load Diff
-186
View File
@@ -1,186 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2001 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <lib/hsm.h>
#include <string.h>
/*******************************************************************************
*
* NAME
* find_test_session - find or create a test DMAPI session.
*
* DESCRIPTION
* find_test_session() is used to find a test DMAPI session to
* use. There is only one test session per host; all test processes
* share the same session. If the session does not already exist,
* then the first process to call find_test_session() causes
* the session to be created.
*
* Note: It is possible for N different programs to call this routine
* at the same time. Each would find that a test session does not
* exist, and each one would then create a new test session. Since
* excess test sessions are not automatically released on death of
* process, we need to make sure that we don't leave such excess
* sessions around. So, after creating a session we go back and find
* the test session with the lowest session number. If it is ours,
* great; we are done. If not, then we must destroy our session
* and use the one with the lower session ID. There is still a risk
* here of creating a session and crashing before it can be removed
* again. To deal with this, the daemon will periodically remove all
* test sessions except for the one with the lowest ID value.
*
* RETURN VALUE
* None.
*
*******************************************************************************/
#define TEST_MSG "DMAPI test session"
static int
session_compare(
const void *a,
const void *b)
{
return(*((dm_sessid_t *)a) - *((dm_sessid_t *)b));
}
extern void
find_test_session(
dm_sessid_t *session)
{
char buffer[DM_SESSION_INFO_LEN];
dm_sessid_t *sidbuf = NULL;
dm_sessid_t new_session;
u_int allocelem = 0;
u_int nelem;
size_t rlen;
int error;
u_int i;
/* Retrieve the list of all active sessions on the host. */
nelem = 100; /* a reasonable first guess */
do {
if (allocelem < nelem) {
allocelem = nelem;
sidbuf = realloc(sidbuf, nelem * sizeof(*sidbuf));
if (sidbuf == NULL) {
fprintf(stderr, "realloc of %lu bytes failed\n",
(unsigned long) nelem * sizeof(*sidbuf));
exit(1);
}
}
error = dm_getall_sessions(allocelem, sidbuf, &nelem);
} while (error < 0 && errno == E2BIG);
/* If an error occurred, translate it into something meaningful. */
if (error < 0) {
fprintf(stderr, "unexpected dm_getall_sessions failure, %s\n",
strerror(errno));
free(sidbuf);
exit(1);
}
/* We have the list of all active sessions. Scan the list looking
for an existing "test" session that we can use. The list must
first be sorted in case other processes happen to be creating test
sessions at the same time; we need to make sure that we pick the one
with the lowest session ID.
*/
qsort(sidbuf, nelem, sizeof(sidbuf[0]), session_compare);
for (i = 0; i < nelem; i++) {
error = dm_query_session(sidbuf[i], sizeof(buffer),
buffer, &rlen);
if (error < 0) {
fprintf(stderr, "unexpected dm_query_session "
"failure, %s\n", strerror(errno));
free(sidbuf);
exit(1);
}
if (!strncmp(buffer, TEST_MSG, strlen(TEST_MSG)))
break;
}
if (i < nelem) {
*session = (dm_sessid_t)sidbuf[i];
free(sidbuf);
return;
}
/* No test session exists, so we have to create one ourselves. */
if (dm_create_session(DM_NO_SESSION, TEST_MSG, &new_session) != 0) {
fprintf(stderr, "dm_create_session failed, %s\n",
strerror(errno));
free(sidbuf);
exit(1);
}
/* Now re-retrieve the list of active sessions. */
do {
if (allocelem < nelem) {
allocelem = nelem;
sidbuf = realloc(sidbuf, nelem * sizeof(*sidbuf));
if (sidbuf == NULL) {
fprintf(stderr, "realloc of %lu bytes failed\n",
(unsigned long) nelem * sizeof(*sidbuf));
exit(1);
}
}
error = dm_getall_sessions(allocelem, sidbuf, &nelem);
} while (error < 0 && errno == E2BIG);
if (error < 0) {
fprintf(stderr, "dm_getall_sessions failed, %s\n",
strerror(errno));
free(sidbuf);
exit(1);
}
/* Sort the session ID list into ascending ID order, then find the
test session with the lowest session ID. We better find at
least one since we created one!
*/
qsort(sidbuf, nelem, sizeof(sidbuf[0]), session_compare);
for (i = 0; i < nelem; i++) {
error = dm_query_session(sidbuf[i], sizeof(buffer),
buffer, &rlen);
if (error < 0) {
fprintf(stderr, "dm_query_session failed, %s\n",
strerror(errno));
free(sidbuf);
exit(1);
}
if (!strncmp(buffer, TEST_MSG, strlen(TEST_MSG)))
break;
}
if (i == nelem) {
fprintf(stderr, "can't find the session we created\n");
free(sidbuf);
exit(1);
}
*session = (dm_sessid_t)sidbuf[i];
free(sidbuf);
/* If the session we are going to use is not the one we created,
then we need to get rid of the created one.
*/
if (*session != new_session) {
if ((new_session) != 0) {
fprintf(stderr, "dm_destroy_session failed, %s\n",
strerror(errno));
exit(1);
}
}
}
-166
View File
@@ -1,166 +0,0 @@
/*
* Defines and structures for our pseudo HSM example
*
* This code was written by Peter Lawthers, and placed in the public
* domain for use by DMAPI implementors and app writers.
*
* Standard disclaimer:
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _LIB_HSM_H
#define _LIB_HSM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <lib/dmport.h>
#define HANDLE_LEN 64 /* Swag for this example */
#define HANDLE_STR ((HANDLE_LEN * 2) + 1) /* handle as ascii, plus null */
#define IBUFSIZE 1024 /* input buffer size */
#define CHUNKSIZE (1024*1024*4) /* write size */
#define FENCEPOST_SIZE ((dm_size_t)(1024*8))
#define ALL_AVAIL_MSGS 0
/*
* Actions to be performed by the worker bees
*/
#define RESTORE_FILE "-r"
#define INVAL_FILE "-i"
#define WORKER_BEE "wbee"
/*
* Names of DM attribute used for storing location of a file's data.
* DM attributes are 8 bytes, including NULL.
*/
#define DLOC_HAN "dhanloc" /* staging file handle */
#define DLOC_HANLEN "dhanlen" /* staging handle length */
/*
* Default log file
*/
#define LOG_DEFAULT "/tmp/dmig_log"
struct ev_name_to_value {
char *name; /* name of event */
dm_eventtype_t value; /* value of event */
};
extern struct ev_name_to_value ev_names[];
extern int ev_namecnt;
struct rt_name_to_value {
char *name; /* name of right */
dm_right_t value; /* value of right */
};
extern struct rt_name_to_value rt_names[];
extern int rt_namecnt;
extern void hantoa(void *hanp, size_t hlen, char *handle_str);
extern int atohan(char *handle_str, void **hanpp, size_t *hlenp);
extern void print_handle(void *hanp, size_t hlen);
extern void print_victim(void *hanp, size_t hlen, dm_off_t fsize);
extern void errno_msg(char *fmt, ...);
extern void err_msg(char *fmt, ...);
extern int setup_dmapi(dm_sessid_t *sid);
extern int get_dmchange(dm_sessid_t sid, void *hanp, size_t hlen,
dm_token_t token, u_int *change_start);
extern int save_filedata(dm_sessid_t sid, void *hanp, size_t hlen,
int stg_fd, dm_size_t fsize);
extern int restore_filedata(dm_sessid_t sid, void *hanp, size_t hlen,
dm_token_t token, void *stg_hanp, size_t stg_hlen, dm_off_t off);
extern void find_test_session(dm_sessid_t *session);
void
print_one_mount_event(
void *msg);
int
print_one_message(
dm_eventmsg_t *msg);
int
handle_message(
dm_sessid_t sid,
dm_eventmsg_t *msg);
extern char *date_to_string(
time_t timeval);
extern char *mode_to_string(
mode_t mode);
extern mode_t field_to_mode(
mode_t mode);
extern int validate_state(
dm_stat_t *dmstat,
char *pathname,
int report_errors);
extern char *emask_to_string(
dm_eventset_t emask);
extern char *xflags_to_string(
u_int xflags);
extern void print_state(
dm_stat_t *dmstat);
extern void print_line(
dm_stat_t *dmstat);
extern dm_eventtype_t
ev_name_to_value(
char *name);
extern char *
ev_value_to_name(
dm_eventtype_t event);
extern int
rt_name_to_value(
char *name,
dm_right_t *rightp);
extern char *
rt_value_to_name(
dm_right_t right);
extern int
opaque_to_handle(
char *name,
void **hanpp,
size_t *hlenp);
#ifdef __cplusplus
}
#endif
#endif /* _LIB_HSM_H */
File diff suppressed because it is too large Load Diff
-491
View File
@@ -1,491 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2001 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <errno.h>
#include <stdlib.h>
#include <lib/dmport.h>
/* See dmport.h for a description of why all these wrapper routines are
necessary. Because SGI defines stub routines for all functions it didn't
implement, no SGI-specific wrappers are required.
*/
#ifdef VERITAS_21
/* The Veritas version of dm_downgrade_right has two additional parameters
not defined in the XDSM spec. Provide values that make dm_downgrade_right
work according to the spec.
*/
extern int
xvfs_dm_downgrade_right(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token)
{
#undef dm_downgrade_right
return(dm_downgrade_right(sid, hanp, hlen, token, 0, DM_RIGHT_SHARED));
}
/* The last byte in a Veritas handle is a 'pad' byte which they don't bother
to initialize to zero. As a result, you can't do binary compares of
two handles to see if they are the same. This stub (along with others)
forces the pad byte to zero so that binary compares are possible
*/
extern int
xvfs_dm_fd_to_handle(
int fd,
void **hanpp,
size_t *hlenp)
{
#undef dm_fd_to_handle
int rc;
if ((rc = dm_fd_to_handle(fd, hanpp, hlenp)) == 0) {
if (*hlenp == 16) {
char *cp = (char *)*hanpp;
cp[15] = '\0';
}
}
return(rc);
}
/* The Veritas version of dm_get_config_events has a slightly different name.
*/
extern int
dm_get_config_events(
void *hanp,
size_t hlen,
u_int nelem,
dm_eventset_t *eventsetp,
u_int *nelemp)
{
return(dm_get_config_event(hanp, hlen, nelem, eventsetp, nelemp));
}
/* In version 2.1 uflags was defined as 'int nowait', so a value of zero in
this field means that the caller wants to wait. In XDSM this was reversed,
where if the bottom bit of uflags is set then the caller wants to wait.
This routine makes the conversion.
*/
extern int
xvfs_dm_get_events(
dm_sessid_t sid,
u_int maxmsgs,
u_int uflags,
size_t buflen,
void *bufp,
size_t *rlenp)
{
#undef dm_get_events
int nowait = 1;
if (uflags & DM_EV_WAIT)
nowait = 0;
return(dm_get_events(sid, maxmsgs, nowait, buflen, bufp, rlenp));
}
/* The Veritas version of dm_get_mountinfo has the parameters in a different
order than in the XDSM spec. Hide this in the wrapper.
*/
extern int
xvfs_dm_get_mountinfo(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
size_t buflen,
void *bufp,
size_t *rlenp)
{
#undef dm_get_mountinfo
return(dm_get_mountinfo(sid, token, hanp, hlen, buflen, bufp, rlenp));
}
/* Veritas does not support the dm_getall_disp function. Furthermore, their
dm_dispinfo_t structure is missing the _link field that is needed for the
DM_STEP_TO_NEXT() macro to work.
*/
extern int
dm_getall_disp(
dm_sessid_t sid,
size_t buflen,
void *bufp,
size_t *rlenp)
{
return(ENOSYS);
}
/* Veritas does not support the dm_getall_dmattr function. Furthermore, their
dm_attrlist_t structure is missing the _link field that is needed for the
DM_STEP_TO_NEXT() macro to work.
*/
extern int
dm_getall_dmattr(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
size_t buflen,
void *bufp,
size_t *rlenp)
{
return(ENOSYS);
}
/* Veritas does not support dm_handle_is_valid. We emulate it by checking
fields which have known values, as DMF uses this a lot.
*/
extern dm_boolean_t
dm_handle_is_valid(
void *hanp,
size_t hlen)
{
char *cp = (char *)hanp;
if (hlen != 16) {
return(DM_FALSE);
}
if (cp[15] != '\0') {
return(DM_FALSE);
}
switch (cp[14]) {
case 1:
case 2:
case 4:
break;
default:
return(DM_FALSE);
}
switch (cp[13]) {
case 0:
case 1:
break;
default:
return(DM_FALSE);
}
return(DM_TRUE);
}
/* Veritas uses a dev_t for their dm_fsid_t, and named their routines
accordingly. Hide this in the wrapper. Note that a dev_t is 32 bits
and the SGI dm_fsid_t is defined to be a uint64_t. If this gets to
be a problem (e.g. %x verus %llx), the Veritas dm_fsid_t could be made
to match SGI with a little casting here and there.
*/
extern int
dm_handle_to_fsid(
void *hanp,
size_t hlen,
dm_fsid_t *fsidp)
{
dev_t dev;
dev = dm_handle_to_dev(hanp, hlen);
*fsidp = (dm_fsid_t)dev;
return(0);
}
/* The Veritas dm_handle_to_fgen returns a long which is really the
file's generation number. dm_igen_t is typedef'd to be a long also,
so the cast here is safe.
*/
extern int
dm_handle_to_igen(
void *hanp,
size_t hlen,
dm_igen_t *igenp)
{
#undef dm_handle_to_igen
long igen;
igen = (dm_igen_t)dm_handle_to_fgen(hanp, hlen);
*igenp = (dm_igen_t)igen;
return(0);
}
/* Veritas uses a long for their dm_ino_t, which is really an ino_t.
Hide this in the wrapper. Note that a ino_t is 32 bits and the SGI
dm_ino_t is defined to be a uint64_t. If this gets to be a problem
(e.g. %x verus %llx), the Veritas dm_ino_t could be made to match SGI
with a little casting here and there.
*/
extern int
xvfs_dm_handle_to_ino(
void *hanp,
size_t hlen,
dm_ino_t *inop)
{
#undef dm_handle_to_ino
long ino;
ino = (dm_ino_t)dm_handle_to_ino(hanp, hlen);
*inop = (dm_ino_t)ino;
return(0);
}
/* Version 2.1 of the spec did not specify the versionstrpp parameter. This
code makes the routine appear to work correctly to the caller, but it
is not really able to do the runtime check that the parameter is
supposed to provide.
*/
extern int
xvfs_dm_init_service(
char **versionstrpp)
{
#undef dm_init_service
*versionstrpp = DM_VER_STR_CONTENTS;
return(dm_init_service());
}
extern int
xvfs_dm_make_fshandle(
dm_fsid_t *fsidp,
void **hanpp,
size_t *hlenp)
{
#undef dm_make_fshandle
dev_t dev;
dev = (dev_t)*fsidp;
return(dm_make_fshandle(dev, hanpp, hlenp));
}
extern int
xvfs_dm_make_handle(
dm_fsid_t *fsidp,
dm_ino_t *inop,
dm_igen_t *igenp,
void **hanpp,
size_t *hlenp)
{
#undef dm_make_handle
dev_t dev;
long ino;
long igen;
dev = (dev_t)*fsidp;
ino = (long)*inop;
igen = (long)*igenp;
return(dm_make_handle(dev, ino, igen, hanpp, hlenp));
}
/* The last byte in a Veritas handle is a 'pad' byte which they don't bother
to initialize to zero. As a result, you can't do binary compares of
two handles to see if they are the same. This stub (along with others)
forces the pad byte to zero so that binary compares are possible
*/
extern int
xvfs_dm_path_to_fshandle(
char *path,
void **fshanpp,
size_t *fshlenp)
{
#undef dm_path_to_fshandle
int rc;
if ((rc = dm_path_to_fshandle(path, fshanpp, fshlenp)) == 0) {
if (*fshlenp == 16) {
char *cp = (char *)*fshanpp;
cp[15] = '\0';
}
}
return(rc);
}
/* The last byte in a Veritas handle is a 'pad' byte which they don't bother
to initialize to zero. As a result, you can't do binary compares of
two handles to see if they are the same. This stub (along with others)
forces the pad byte to zero so that binary compares are possible
*/
extern int
xvfs_dm_path_to_handle(
char *path,
void **hanpp,
size_t *hlenp)
{
#undef dm_path_to_handle
int rc;
if ((rc = dm_path_to_handle(path, hanpp, hlenp)) == 0) {
if (*hlenp == 16) {
char *cp = (char *)*hanpp;
cp[15] = '\0';
}
}
return(rc);
}
/* Veritas has a prototype for this function even though it is not
implemented.
*/
extern int
xvfs_dm_pending(
dm_sessid_t sid,
dm_token_t token,
dm_timestruct_t *delay)
{
#undef dm_pending
return(ENOSYS);
}
extern int
xvfs_dm_read_invis(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
dm_off_t off,
dm_size_t len,
void *bufp)
{
#undef dm_read_invis
return(dm_read_invis(sid, hanp, hlen, token, off, (dm_ssize_t)len, bufp));
}
/* In version 2.1 uflags was defined as 'int nowait', so a value of zero in
this field means that the caller wants to wait. In XDSM this was reversed,
where if the bottom bit of uflags is set then the caller wants to wait.
This routine makes the conversion.
*/
extern int
xvfs_dm_request_right(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
u_int uflags,
dm_right_t right)
{
#undef dm_request_right
int nowait = 1;
if (uflags & DM_RR_WAIT)
nowait = 0;
return(dm_request_right(sid, hanp, hlen, token, nowait, right));
}
extern int
xvfs_dm_set_inherit(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
dm_attrname_t *attrnamep,
mode_t mode)
{
#undef dm_set_inherit
return(dm_set_inherit(sid, hanp, hlen, token, attrnamep, (u_int)mode));
}
extern int
xvfs_dm_set_region(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
u_int nelem,
dm_region_t *regbufp,
dm_boolean_t *exactflagp)
{
#undef dm_set_region
return(dm_set_region(sid, hanp, hlen, token, nelem, regbufp, (u_int *)exactflagp));
}
extern int
dm_set_return_on_destroy(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
dm_attrname_t *attrnamep,
dm_boolean_t enable)
{
return(dm_set_return_ondestroy(sid, hanp, hlen, token, attrnamep, (int)enable));
}
extern int
xvfs_dm_sync_by_handle(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token)
{
#undef dm_sync_by_handle
return((int)dm_sync_by_handle(sid, hanp, hlen, token));
}
extern int
xvfs_dm_upgrade_right(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token)
{
#undef dm_upgrade_right
return(dm_upgrade_right(sid, hanp, hlen, token, 0, DM_RIGHT_EXCL));
}
extern int
xvfs_dm_write_invis(
dm_sessid_t sid,
void *hanp,
size_t hlen,
dm_token_t token,
int flags,
dm_off_t off,
dm_size_t len,
void *bufp)
{
#undef dm_write_invis
return(dm_write_invis(sid, hanp, hlen, token, off, (dm_ssize_t)len, bufp, flags));
}
#endif

Some files were not shown because too many files have changed in this diff Show More