X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fobdio.c;h=62212b89de3f4c3a1091b3f9a8592d8292a84fd1;hb=54721a3902c853dea73bde97a2c93a9618a67018;hp=0152064a1d1929b9b0cf3e7d4119b198831f449b;hpb=113303973ec9f8484eb2355a1a6ef3c4c7fd6a56;p=fs%2Flustre-release.git diff --git a/lustre/utils/obdio.c b/lustre/utils/obdio.c index 0152064a..62212b8 100644 --- a/lustre/utils/obdio.c +++ b/lustre/utils/obdio.c @@ -1,24 +1,41 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * Copyright (C) 2002 Cluster File Systems, Inc. - * Author: Eric Barton + * GPL HEADER START * - * This file is part of Lustre, http://www.lustre.org. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Lustre is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. * - * Lustre 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. + * 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 version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). * - * You should have received a copy of the GNU General Public License - * along with Lustre; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + * GPL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Use is subject to license terms. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * lustre/utils/obdio.c + * + * Author: Eric Barton */ #include @@ -31,14 +48,14 @@ int obdio_test_fixed_extent (struct obdio_conn *conn, - uint32_t myhid, uint32_t mypid, - int reps, int locked, uint64_t oid, - uint64_t offset, uint32_t size) + __u32 myhid, __u32 mypid, + int reps, int locked, __u64 oid, + __u64 offset, __u32 size) { struct lustre_handle lh; void *space; void *buffer; - uint32_t *ibuf; + __u32 *ibuf; int i; int j; int rc = 0; @@ -50,7 +67,7 @@ obdio_test_fixed_extent (struct obdio_conn *conn, } for (i = 0; i < reps; i++) { - ibuf = (uint32_t *) buffer; + ibuf = (__u32 *) buffer; for (j = 0; j < size / (4 * sizeof (*ibuf)); j++) { ibuf[0] = myhid; ibuf[1] = mypid; @@ -104,7 +121,7 @@ obdio_test_fixed_extent (struct obdio_conn *conn, } } - ibuf = (uint32_t *) buffer; + ibuf = (__u32 *) buffer; for (j = 0; j < size / (4 * sizeof (*ibuf)); j++) { if (ibuf[0] != myhid || ibuf[1] != mypid || @@ -129,9 +146,9 @@ obdio_test_fixed_extent (struct obdio_conn *conn, } int -parse_kmg (uint64_t *valp, char *str) +parse_kmg (__u64 *valp, char *str) { - uint64_t val; + __u64 val; char mod[32]; switch (sscanf (str, LPU64"%1[gGmMkK]", &val, mod)) @@ -184,18 +201,18 @@ usage (char *cmdname, int help) int main (int argc, char **argv) { - uint32_t mypid = getpid (); - uint32_t myhid = gethostid (); - uint64_t oid; - uint64_t base_offset = 0; - uint32_t size = 0; + __u32 mypid = getpid (); + __u32 myhid = gethostid (); + __u64 oid; + __u64 base_offset = 0; + __u32 size = 0; int set_size = 0; int device = -1; int reps = 1; int locked = 0; char *end; struct obdio_conn *conn; - uint64_t val; + __u64 val; int v1; int v2; int rc; @@ -229,7 +246,7 @@ main (int argc, char **argv) optarg); return (1); } - size = (uint32_t)val; + size = (__u32)val; set_size++; break; @@ -293,5 +310,3 @@ main (int argc, char **argv) return (rc == 0 ? 0 : 1); } - -