generic/496: ext4 and xfs supports swapon on fallocated file
[xfstests-dev.git] / lib / tlibio.c
index 82386e32504709bad2936b4fcfeb3aedf4162039..f7259734af97c753fc6f2c57301af0f26b733795 100644 (file)
@@ -1,19 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.
  * All Rights Reserved.
- *
- * 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.
- *
- * This program is distributed in the hope that it would 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 the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 /*
  *
@@ -209,7 +197,7 @@ int *max;
  * This function will allow someone to set the debug level.
  ***********************************************************************/
 int
-lio_set_debug(level)
+lio_set_debug(int level)
 {
     int old;
 
@@ -465,7 +453,6 @@ char **errmsg;      /* char pointer that will be updated to point to err message */
 long wrd;      /* to allow future features, use zero for now */
 {
     int ret = 0;       /* syscall return or used to get random method */
-    char *io_type;             /* Holds string of type of io */
 #ifndef linux
     int omethod = method;
     int listio_cmd;            /* Holds the listio/lio_listio cmd */
@@ -514,10 +501,8 @@ long wrd;  /* to allow future features, use zero for now */
     /*
      * Determine the system call that will be called and produce
      * the string of the system call and place it in Lio_SysCall.
-     * Also update the io_type char pointer to give brief description
-     * of system call.  Execute the system call and check for
-     * system call failure.  If sync i/o, return the number of
-     * bytes written/read.
+     * Execute the system call and check for system call failure.
+     * If sync i/o, return the number of bytes written/read.
      */
      
     if ( (method & LIO_IO_SYNC) || (method & LIO_IO_TYPES) == 0 ){
@@ -528,7 +513,6 @@ long wrd;   /* to allow future features, use zero for now */
 
        sprintf(Lio_SysCall,
            "write(%d, buf, %d)", fd, size);
-       io_type="write";
 
         if ( Debug_level ) {
            printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__, Lio_SysCall);
@@ -556,7 +540,6 @@ long wrd;   /* to allow future features, use zero for now */
     }
 
     else if ( method & LIO_IO_SYNCV ) {
-       io_type="writev(2)";
 
        sprintf(Lio_SysCall, 
                "writev(%d, &iov, 1) nbyte:%d", fd, size);
@@ -667,7 +650,6 @@ char **errmsg;      /* char pointer that will be updated to point to err message */
 long wrd;      /* to allow future features, use zero for now */
 {
     int ret = 0;       /* syscall return or used to get random method */
-    char *io_type;             /* Holds string of type of io */
 #ifndef linux
     int listio_cmd;            /* Holds the listio/lio_listio cmd */
     int omethod = method;
@@ -716,10 +698,8 @@ long wrd;  /* to allow future features, use zero for now */
     /*
      * Determine the system call that will be called and produce
      * the string of the system call and place it in Lio_SysCall.
-     * Also update the io_type char pointer to give brief description
-     * of system call.  Execute the system call and check for
-     * system call failure.  If sync i/o, return the number of
-     * bytes written/read.
+     * Execute the system call and check for system call failure.
+     * If sync i/o, return the number of bytes written/read.
      */
      
     if ( (method & LIO_IO_SYNC) || (method & LIO_IO_TYPES) == 0 ){
@@ -730,7 +710,6 @@ long wrd;   /* to allow future features, use zero for now */
 
        sprintf(Lio_SysCall,
            "read(%d, buf, %d)", fd, size);
-       io_type="read";
 
         if ( Debug_level ) {
            printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__, Lio_SysCall);
@@ -758,7 +737,6 @@ long wrd;   /* to allow future features, use zero for now */
     }
 
     else if ( method & LIO_IO_SYNCV ) {
-       io_type="readv(2)";
 
        sprintf(Lio_SysCall, 
                "readv(%d, &iov, 1) nbyte:%d", fd, size);