diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 6ed88cb52..d8c27caac 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,7 @@ 2003-10-11 Pavel Roskin + * tarfs.c: Switch to self-registration. + * extfs.c: Don't include xdirentry.h. * vfs.c: Likewise. diff --git a/vfs/tar.c b/vfs/tar.c index aae6d20ef..f3e7d3f03 100644 --- a/vfs/tar.c +++ b/vfs/tar.c @@ -30,6 +30,8 @@ #include "tar.h" #include "names.h" +static struct vfs_class vfs_tarfs_ops; + #define isodigit(c) ( ((c) >= '0') && ((c) <= '7') ) /* * Quick and dirty octal conversion. @@ -521,60 +523,16 @@ static struct vfs_s_data tarfs_data = { NULL }; -vfs vfs_tarfs_ops = +void +init_tarfs (void) { - NULL, /* This is place of next pointer */ - "tarfs", - 0, /* flags */ - "utar", /* prefix */ - &tarfs_data, - 0, /* errno */ - NULL, - NULL, - vfs_s_fill_names, - NULL, - - vfs_s_open, - vfs_s_close, - tar_read, - NULL, - - vfs_s_opendir, - vfs_s_readdir, - vfs_s_closedir, - vfs_s_telldir, - vfs_s_seekdir, - - vfs_s_stat, - vfs_s_lstat, - vfs_s_fstat, - - NULL, - NULL, - NULL, - - vfs_s_readlink, - NULL, - NULL, - NULL, - - NULL, - vfs_s_chdir, - vfs_s_ferrno, - vfs_s_lseek, - NULL, - - vfs_s_getid, - vfs_s_nothingisopen, - vfs_s_free, - - vfs_s_getlocalcopy, - tar_ungetlocalcopy, - - NULL, /* mkdir */ - NULL, - NULL, - NULL - -MMAPNULL -}; + vfs_s_init_class (&vfs_tarfs_ops); + vfs_tarfs_ops.name = "tarfs"; + vfs_tarfs_ops.prefix = "utar"; + vfs_tarfs_ops.data = &tarfs_data; + vfs_tarfs_ops.read = tar_read; + vfs_tarfs_ops.write = NULL; + vfs_tarfs_ops.ungetlocalcopy = tar_ungetlocalcopy; + vfs_tarfs_ops.setctl = NULL; + vfs_register_class (&vfs_tarfs_ops); +} diff --git a/vfs/vfs.c b/vfs/vfs.c index 1f3241521..cecb24719 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -1231,7 +1231,7 @@ vfs_init (void) vfs_register_class (&vfs_extfs_ops); vfs_register_class (&vfs_sfs_ops); - vfs_register_class (&vfs_tarfs_ops); + init_tarfs (); init_cpiofs (); #ifdef USE_EXT2FSLIB diff --git a/vfs/vfs.h b/vfs/vfs.h index e1ef0135d..698a2d23f 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -99,12 +99,13 @@ union vfs_dirent { /* Register a file system class */ int vfs_register_class (struct vfs_class *vfs); + void init_cpiofs (void); void init_fish (void); void init_ftpfs (void); +void init_tarfs (void); extern vfs vfs_local_ops; -extern vfs vfs_tarfs_ops; extern vfs vfs_smbfs_ops; extern vfs vfs_mcfs_ops; extern vfs vfs_extfs_ops;