]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs update to tidy up some libhandle code
authorNathan Scott <nathans@sgi.com>
Mon, 2 Jun 2003 04:11:24 +0000 (04:11 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 2 Jun 2003 04:11:24 +0000 (04:11 +0000)
VERSION
debian/changelog
doc/CHANGES
libhandle/Makefile
libhandle/handle.c

diff --git a/VERSION b/VERSION
index 00178f9a871b7bbcc1d5031b0b77e0390cad7880..eca795626f666b3bc3b50f0232ae14b181d3e37f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=4
-PKG_REVISION=11
+PKG_REVISION=12
 PKG_BUILD=0
index 4fea2e1524760d572dea10da1cc5213bf9a39ad6..56e79fd5285ab3b7bb8820b294a0b5f63def1e0b 100644 (file)
@@ -1,8 +1,8 @@
-xfsprogs (2.4.11-1) unstable; urgency=low
+xfsprogs (2.4.12-1) unstable; urgency=low
 
   * New upstream release
 
- -- Nathan Scott <nathans@debian.org>  Fri, 30 May 2003 14:57:17 +1000
+ -- Nathan Scott <nathans@debian.org>  Mon,  2 Jun 2003 13:51:06 +1000
 
 xfsprogs (2.4.10-1) unstable; urgency=low
 
index 6e0f3012fc1f8e707a12bbd01ea598498d35a22e..f74be89bd35bb8f88568d8f66dcacf6a845fedfb 100644 (file)
@@ -1,3 +1,8 @@
+xfsprogs-2.4.12 (02 June 2003)
+       - Fix xfs_logprint handling of any version 2 log device.
+       - Remove calls to exit in libhandle, propogate errors to
+         caller, and bumped libhandle version from 1.0.1 to 1.0.2.
+
 xfsprogs-2.4.11 (30 May 2003)
        - Extract device sector size at mkfs time and issue warnings
          if the requested filesystem sector size is too small.
index 898ec6f5eecf7c7b8a0726397a543795dd6c6f38..155ad481b9a4d3081a4494db19acadd6681d6c0a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of version 2 of the GNU General Public License as
@@ -35,7 +35,7 @@ include $(TOPDIR)/include/builddefs
 
 LTLIBRARY = libhandle.la
 LT_CURRENT = 1
-LT_REVISION = 1
+LT_REVISION = 2
 LT_AGE = 0
 
 CFILES = handle.c jdm.c
index 4433dc76841cef978e2e533343293c61141aed1a..dd6949becb05b78ca7eaf52997ca7b9b189591b7 100644 (file)
@@ -56,19 +56,8 @@ typedef union {
        char    *path;
 } comarg_t;
 
-static int
-obj_to_handle (
-       char            *fspath,
-       int             fsfd,
-       unsigned int    opcode,
-       comarg_t        obj,
-       void            **hanp,
-       size_t          *hlen);
-
-static int
-handle_to_fsfd (
-       void            *hanp,
-       char            **path);
+static int obj_to_handle(char *, int, unsigned int, comarg_t, void**, size_t*);
+static int handle_to_fsfd(void *, char **);
 
 
 /*
@@ -86,10 +75,10 @@ struct fdhash {
        char    fspath[MAXPATHLEN];
 };
 
-static struct fdhash *fdhash_head = NULL;
+static struct fdhash *fdhash_head;
 
 int
-path_to_fshandle (
+path_to_fshandle(
        char            *path,          /* input,  path to convert */
        void            **hanp,         /* output, pointer to data */
        size_t          *hlen)          /* output, size of returned data */
@@ -100,17 +89,12 @@ path_to_fshandle (
        struct fdhash   *fdhp;
 
        fd = open(path, O_RDONLY);
-
-       if (fd <  0) {
-               perror(path);
-               exit(1);
-       }
+       if (fd < 0)
+               return -1;
 
        obj.path = path;
-
        result = obj_to_handle(path, fd, XFS_IOC_PATH_TO_FSHANDLE,
                                obj, hanp, hlen);
-
        if (result >= 0) {
                fdhp = malloc(sizeof(struct fdhash));
                if (fdhp == NULL) {
@@ -132,9 +116,8 @@ path_to_fshandle (
        return result;
 }
 
-
 int
-path_to_handle (
+path_to_handle(
        char            *path,          /* input,  path to convert */
        void            **hanp,         /* output, pointer to data */
        size_t          *hlen)          /* output, size of returned data */
@@ -144,24 +127,18 @@ path_to_handle (
        comarg_t        obj;
 
        fd = open(path, O_RDONLY);
-
-       if (fd <  0) {
-               perror(path);
-               exit(1);
-       }
+       if (fd < 0)
+               return -1;
 
        obj.path = path;
-
-       result = obj_to_handle (path, fd, XFS_IOC_PATH_TO_HANDLE, obj, hanp, hlen);
-
+       result = obj_to_handle(path, fd, XFS_IOC_PATH_TO_HANDLE,
+                               obj, hanp, hlen);
        close(fd);
-
        return result;
 }
 
-
 int
-handle_to_fshandle (
+handle_to_fshandle(
        void            *hanp,
        size_t          hlen,
        void            **fshanp,
@@ -169,20 +146,14 @@ handle_to_fshandle (
 {
        if (hlen < FSIDSIZE)
                return EINVAL;
-
-       *fshanp = malloc (FSIDSIZE);
-
+       *fshanp = malloc(FSIDSIZE);
        if (*fshanp == NULL)
                return ENOMEM;
-
        *fshlen = FSIDSIZE;
-
        memcpy(*fshanp, hanp, FSIDSIZE);
-
        return 0;
 }
 
-
 static int
 handle_to_fsfd(void *hanp, char **path)
 {
@@ -194,12 +165,12 @@ handle_to_fsfd(void *hanp, char **path)
                        return fdhp->fsfd;
                }
        }
+       errno = EBADF;
        return -1;
 }
 
-
 static int
-obj_to_handle (
+obj_to_handle(
        char            *fspath,
        int             fsfd,
        unsigned int    opcode,
@@ -236,13 +207,11 @@ obj_to_handle (
        }
 
        memcpy(*hanp, hbuf, (int) *hlen);
-
        return 0;
 }
 
-
 int
-open_by_handle (
+open_by_handle(
        void            *hanp,
        size_t          hlen,
        int             rw)
@@ -251,10 +220,8 @@ open_by_handle (
        char            *path;
        xfs_fsop_handlereq_t hreq;
 
-       if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
-               errno = EBADF;
+       if ((fd = handle_to_fsfd(hanp, &path)) < 0)
                return -1;
-       }
 
        hreq.fd       = 0;
        hreq.path     = NULL;
@@ -268,7 +235,7 @@ open_by_handle (
 }
 
 int
-readlink_by_handle (
+readlink_by_handle(
        void            *hanp,
        size_t          hlen,
        void            *buf,
@@ -278,11 +245,8 @@ readlink_by_handle (
        char            *path;
        xfs_fsop_handlereq_t hreq;
 
-
-       if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
-               errno = EBADF;
+       if ((fd = handle_to_fsfd(hanp, &path)) < 0)
                return -1;
-       }
 
        hreq.fd       = 0;
        hreq.path     = NULL;
@@ -307,10 +271,8 @@ attr_multi_by_handle(
        char            *path;
        xfs_fsop_attrmulti_handlereq_t amhreq;
 
-       if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
-               errno = EBADF;
+       if ((fd = handle_to_fsfd(hanp, &path)) < 0)
                return -1;
-       }
 
        amhreq.hreq.fd       = 0;
        amhreq.hreq.path     = NULL;
@@ -339,10 +301,8 @@ attr_list_by_handle(
        char            *path;
        xfs_fsop_attrlist_handlereq_t alhreq;
 
-       if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
-               errno = EBADF;
+       if ((fd = handle_to_fsfd(hanp, &path)) < 0)
                return -1;
-       }
 
        alhreq.hreq.fd       = 0;
        alhreq.hreq.path     = NULL;
@@ -361,7 +321,7 @@ attr_list_by_handle(
 }
 
 int
-fssetdm_by_handle (
+fssetdm_by_handle(
        void            *hanp,
        size_t          hlen,
        struct fsdmidata *fsdmidata)
@@ -370,11 +330,8 @@ fssetdm_by_handle (
        char            *path;
        xfs_fsop_setdm_handlereq_t dmhreq;
 
-
-       if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
-               errno = EBADF;
+       if ((fd = handle_to_fsfd(hanp, &path)) < 0)
                return -1;
-       }
 
        dmhreq.hreq.fd       = 0;
        dmhreq.hreq.path     = NULL;
@@ -389,11 +346,10 @@ fssetdm_by_handle (
        return xfsctl(path, fd, XFS_IOC_FSSETDM_BY_HANDLE, &dmhreq);
 }
 
-/*ARGSUSED*/
 void
-free_handle (
+free_handle(
        void            *hanp,
        size_t          hlen)
 {
-       free (hanp);
+       free(hanp);
 }