[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Remove useless fsip_fs_free(). Delegate freeing of private data to its plugin



# HG changeset patch
# User john.levon@xxxxxxx
# Date 1168973660 28800
# Node ID 2ff7dedde1e3b3b6167c9a9246c0335ad358a96e
# Parent  fd2667419c53ce2555c799acf3e84dd25912bcb5
Remove useless fsip_fs_free(). Delegate freeing of private data to its plugin
users. Miscellaneous tidy.

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/libfsimage/common/fsimage.c        |    2 +-
 tools/libfsimage/common/fsimage_grub.c   |    2 ++
 tools/libfsimage/common/fsimage_plugin.c |    8 --------
 tools/libfsimage/common/fsimage_plugin.h |    5 ++---
 tools/libfsimage/common/mapfile-GNU      |    3 +--
 tools/libfsimage/common/mapfile-SunOS    |    3 +--
 tools/libfsimage/ext2fs-lib/ext2fs-lib.c |    2 ++
 7 files changed, 9 insertions(+), 16 deletions(-)

diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/common/fsimage.c
--- a/tools/libfsimage/common/fsimage.c Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/common/fsimage.c Tue Jan 16 10:54:20 2007 -0800
@@ -74,7 +74,7 @@ void fsi_close_fsimage(fsi_t *fsi)
        pthread_mutex_lock(&fsi_lock);
         fsi->f_plugin->fp_ops->fpo_umount(fsi);
         (void) close(fsi->f_fd);
-       fsip_fs_free(fsi);
+       free(fsi);
        pthread_mutex_unlock(&fsi_lock);
 }
 
diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/common/fsimage_grub.c
--- a/tools/libfsimage/common/fsimage_grub.c    Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/common/fsimage_grub.c    Tue Jan 16 10:54:20 2007 -0800
@@ -193,6 +193,7 @@ static int
 static int
 fsig_umount(fsi_t *fsi)
 {
+       free(fsi->f_data);
        return (0);
 }
 
@@ -250,6 +251,7 @@ static int
 static int
 fsig_close(fsi_file_t *ffi)
 {
+       free(ffi->ff_data);
        fsip_file_free(ffi);
        return (0);
 }
diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/common/fsimage_plugin.c
--- a/tools/libfsimage/common/fsimage_plugin.c  Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/common/fsimage_plugin.c  Tue Jan 16 10:54:20 2007 -0800
@@ -40,13 +40,6 @@ fsip_fs_set_data(fsi_t *fsi, void *data)
        fsi->f_data = data;
 }
 
-void
-fsip_fs_free(fsi_t *fsi)
-{
-       free(fsi->f_data);
-       free(fsi);
-}
-
 fsi_file_t *
 fsip_file_alloc(fsi_t *fsi, void *data)
 {
@@ -64,7 +57,6 @@ void
 void
 fsip_file_free(fsi_file_t *ffi)
 {
-       free(ffi->ff_data);
        free(ffi);
 }
 
diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/common/fsimage_plugin.h
--- a/tools/libfsimage/common/fsimage_plugin.h  Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/common/fsimage_plugin.h  Tue Jan 16 10:54:20 2007 -0800
@@ -50,11 +50,10 @@ typedef fsi_plugin_ops_t *
     (*fsi_plugin_init_t)(int, fsi_plugin_t *, const char **);
 
 void fsip_fs_set_data(fsi_t *, void *);
-void fsip_fs_free(fsi_t *);
 fsi_file_t *fsip_file_alloc(fsi_t *, void *);
 void fsip_file_free(fsi_file_t *);
-fsi_t * fsip_fs(fsi_file_t *ffi);
-uint64_t fsip_fs_offset(fsi_t *fsi);
+fsi_t *fsip_fs(fsi_file_t *);
+uint64_t fsip_fs_offset(fsi_t *);
 void *fsip_fs_data(fsi_t *);
 void *fsip_file_data(fsi_file_t *);
 
diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/common/mapfile-GNU
--- a/tools/libfsimage/common/mapfile-GNU       Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/common/mapfile-GNU       Tue Jan 16 10:54:20 2007 -0800
@@ -1,5 +1,5 @@ VERSION {
 VERSION {
-       libfsimage.so.1.1 {
+       libfsimage.so.1.0 {
                global:
                        fsi_open_fsimage;
                        fsi_close_fsimage;
@@ -10,7 +10,6 @@ VERSION {
                        fsi_pread_file;
        
                        fsip_fs_set_data;
-                       fsip_fs_free;
                        fsip_file_alloc;
                        fsip_file_free;
                        fsip_fs;
diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/common/mapfile-SunOS
--- a/tools/libfsimage/common/mapfile-SunOS     Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/common/mapfile-SunOS     Tue Jan 16 10:54:20 2007 -0800
@@ -1,4 +1,4 @@ libfsimage.so.1.1 {
-libfsimage.so.1.1 {
+libfsimage.so.1.0 {
        global:
                fsi_open_fsimage;
                fsi_close_fsimage;
@@ -9,7 +9,6 @@ libfsimage.so.1.1 {
                fsi_pread_file;
 
                fsip_fs_set_data;
-               fsip_fs_free;
                fsip_file_alloc;
                fsip_file_free;
                fsip_fs;
diff -r fd2667419c53 -r 2ff7dedde1e3 tools/libfsimage/ext2fs-lib/ext2fs-lib.c
--- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c  Tue Jan 16 14:04:12 2007 -0500
+++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c  Tue Jan 16 10:54:20 2007 -0800
@@ -58,9 +58,11 @@ ext2lib_umount(fsi_t *fsi)
 {
        ext2_filsys *fs = fsip_fs_data(fsi);
        if (ext2fs_close(*fs) != 0) {
+               free(fs);
                errno = EINVAL;
                return (-1);
        }
+       free(fs);
        return (0);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.