aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libfsimage/common
diff options
context:
space:
mode:
authorjohn.levon@sun.com <john.levon@sun.com>2007-01-16 10:54:20 -0800
committerjohn.levon@sun.com <john.levon@sun.com>2007-01-16 10:54:20 -0800
commit96002a7e9b93c9363136534fd1821c5743b323fa (patch)
tree740de41bac22b17d08f2789da47af84fbcf3a9cf /tools/libfsimage/common
parenta086d29d0e360e83eafed55959c3e4e2a1340a38 (diff)
downloadxen-96002a7e9b93c9363136534fd1821c5743b323fa.tar.gz
xen-96002a7e9b93c9363136534fd1821c5743b323fa.tar.bz2
xen-96002a7e9b93c9363136534fd1821c5743b323fa.zip
Remove useless fsip_fs_free(). Delegate freeing of private data to its plugin
users. Miscellaneous tidy. Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'tools/libfsimage/common')
-rw-r--r--tools/libfsimage/common/fsimage.c2
-rw-r--r--tools/libfsimage/common/fsimage_grub.c2
-rw-r--r--tools/libfsimage/common/fsimage_plugin.c8
-rw-r--r--tools/libfsimage/common/fsimage_plugin.h5
-rw-r--r--tools/libfsimage/common/mapfile-GNU3
-rw-r--r--tools/libfsimage/common/mapfile-SunOS3
6 files changed, 7 insertions, 16 deletions
diff --git a/tools/libfsimage/common/fsimage.c b/tools/libfsimage/common/fsimage.c
index a326fd7644..08262f81ce 100644
--- a/tools/libfsimage/common/fsimage.c
+++ b/tools/libfsimage/common/fsimage.c
@@ -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 --git a/tools/libfsimage/common/fsimage_grub.c b/tools/libfsimage/common/fsimage_grub.c
index 252445f58e..99481064a9 100644
--- a/tools/libfsimage/common/fsimage_grub.c
+++ b/tools/libfsimage/common/fsimage_grub.c
@@ -193,6 +193,7 @@ fsig_mount(fsi_t *fsi, const char *path)
static int
fsig_umount(fsi_t *fsi)
{
+ free(fsi->f_data);
return (0);
}
@@ -250,6 +251,7 @@ fsig_read(fsi_file_t *ffi, void *buf, size_t nbytes)
static int
fsig_close(fsi_file_t *ffi)
{
+ free(ffi->ff_data);
fsip_file_free(ffi);
return (0);
}
diff --git a/tools/libfsimage/common/fsimage_plugin.c b/tools/libfsimage/common/fsimage_plugin.c
index 71099ba2ff..f961648164 100644
--- a/tools/libfsimage/common/fsimage_plugin.c
+++ b/tools/libfsimage/common/fsimage_plugin.c
@@ -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 @@ fsip_file_alloc(fsi_t *fsi, void *data)
void
fsip_file_free(fsi_file_t *ffi)
{
- free(ffi->ff_data);
free(ffi);
}
diff --git a/tools/libfsimage/common/fsimage_plugin.h b/tools/libfsimage/common/fsimage_plugin.h
index 4592e08be7..f1c83fab95 100644
--- a/tools/libfsimage/common/fsimage_plugin.h
+++ b/tools/libfsimage/common/fsimage_plugin.h
@@ -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 --git a/tools/libfsimage/common/mapfile-GNU b/tools/libfsimage/common/mapfile-GNU
index f15060cba4..4bffdeafb0 100644
--- a/tools/libfsimage/common/mapfile-GNU
+++ b/tools/libfsimage/common/mapfile-GNU
@@ -1,5 +1,5 @@
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 --git a/tools/libfsimage/common/mapfile-SunOS b/tools/libfsimage/common/mapfile-SunOS
index 1ea38bed04..63f17e1832 100644
--- a/tools/libfsimage/common/mapfile-SunOS
+++ b/tools/libfsimage/common/mapfile-SunOS
@@ -1,4 +1,4 @@
-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;