From svn-commits at oss.oracle.com Tue Sep 4 12:00:04 2007 From: svn-commits at oss.oracle.com (svn-commits@oss.oracle.com) Date: Tue Sep 4 12:00:06 2007 Subject: [Fscat-commits] jlbec commits r68 - trunk/documentation Message-ID: Author: jlbec Date: 2007-09-04 12:00:03 -0700 (Tue, 04 Sep 2007) New Revision: 68 Modified: trunk/documentation/fscat_driver.txt Log: Some spelling corrections Modified: trunk/documentation/fscat_driver.txt =================================================================== --- trunk/documentation/fscat_driver.txt 2005-08-03 03:09:48 UTC (rev 67) +++ trunk/documentation/fscat_driver.txt 2007-09-04 19:00:03 UTC (rev 68) @@ -37,7 +37,7 @@ option selects dump mode. The '-0' (zero) option changes the filename terminator from '\n' to '\0'. This behavior is like "find -print0" and "xargs -0", allowing fully capable filenames. The fscat(8) utility -lways calls the driver with the '-0' option. Finally, the '-n' option +always calls the driver with the '-0' option. Finally, the '-n' option tells dump mode to 'not' dump. That is, it will skip file contents. This is used for a detailed listing of the filesystem by fsls(8). @@ -52,10 +52,10 @@ The inode number is a base-10 number that can be used to retrieve the -inode later. How the filesystem creates and interperets this number is +inode later. How the filesystem creates and interprets this number is up to the driver. The space is a single space. The relative path is the path from the root of the filesystem to the actual object, without a -leading '/'. Finally, the seperator is '\n' by default or '\0' if the +leading '/'. Finally, the separator is '\n' by default or '\0' if the '-0' option was specified. For example, a kernel tree in the root of a filesystem might look like: @@ -71,13 +71,13 @@ Dump mode takes the output of list mode as its input. It will expect the input to have '\n' as the separator unless the '-0' option was -specified. If '-0' was specified, it will expext the input to be +specified. If '-0' was specified, it will expect the input to be separated by '\0'. This input may have been modified by a filter script. Note that the driver will not do anything with the filenames it is passed. They are merely passed on unchanged to the archiver. So a filter program could -substitute or eliminiate filenames before letting the driver dump the +substitute or eliminate filenames before letting the driver dump the inodes. [Dump Mode Output Format] @@ -95,7 +95,7 @@ -This is a pretty flexible format, but fscat does not allow permuation. +This is a pretty flexible format, but fscat does not allow permutation. That is, each header field must come in correct order, or the dump is corrupted. This allows good checking of consistency. The header fields are as follows. @@ -108,10 +108,10 @@ This signifies a fscat data stream. The second valid magic number is "FSCAT101". This signifies a data stream without file contents, produced by a driver with the '-n' option. fsls(8) uses this output to -provide a detaild file listing. Any other value means that the record +provide a detailed file listing. Any other value means that the record is invalid. Filesystem drivers that allow a debug mode to print non-valid records can use the magic string "FSCAT000" (also padded) to -prevent the archiver from trying correctly interperate the ouput. +prevent the archiver from trying correctly interpret the output. inode: @@ -186,7 +186,7 @@ Unless in list ('-n') mode, after the header comes the file data, raw, up to length. Symbolic links are stored as file data, exactly length. Devices are stored in major,minor -format. Each number is an 8 character zero-padded hexidecimal value, +format. Each number is an 8 character zero-padded hexadecimal value, terminated by a newline. That is "%08X\n%08X\n". Directories, FIFOS, and other special files do not have any file data. The archiver will see the file type in the mode and will ignore . From svn-commits at oss.oracle.com Tue Sep 4 12:02:18 2007 From: svn-commits at oss.oracle.com (svn-commits@oss.oracle.com) Date: Tue Sep 4 12:02:19 2007 Subject: [Fscat-commits] jlbec commits r69 - trunk Message-ID: Author: jlbec Date: 2007-09-04 12:02:17 -0700 (Tue, 04 Sep 2007) New Revision: 69 Modified: trunk/Makefile trunk/configure.in trunk/ocfs2.c Log: Bring the ocfs2 driver up to date with the modern libocfs2. This includes directly naming the structures ("struct ocfs2_dinode" vs "ocfs2_dinode") and expecting the includes to be installed (usually via the ocfs2-tools-devel package. Also, check for some caching functions. The functions are recent enought that we don't want to assume either way, we just want to use what is available. Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2007-09-04 19:00:03 UTC (rev 68) +++ trunk/Makefile 2007-09-04 19:02:17 UTC (rev 69) @@ -54,18 +54,8 @@ DEFINES = -DVERSION=\"$(VERSION)\" $(DEFS) -OCFS2_DEFINES = -DO2CB_FLAT_INCLUDES -DO2DLM_FLAT_INCLUDES -DOCFS2_FLAT_INCLUDES +OCFS2_LIBS = -locfs2 -lo2dlm -lo2cb -OCFS2_INCLUDES = \ - -I$(OCFS2_TOOLS_PATH)/libo2cb/include \ - -I$(OCFS2_TOOLS_PATH)/libo2dlm/include \ - -I$(OCFS2_TOOLS_PATH)/libocfs2/include -OCFS2_LIBS = \ - -L$(OCFS2_TOOLS_PATH)/libo2cb \ - -L$(OCFS2_TOOLS_PATH)/libo2dlm \ - -L$(OCFS2_TOOLS_PATH)/libocfs2 \ - -locfs2 -lo2dlm -lo2cb - EXT2_INCLUDES = EXT2_LIBS = -lext2fs @@ -155,7 +145,6 @@ dist-subdircreate: $(TOPDIR)/mkinstalldirs $(DIST_DIR)/debian -ocfs2_CPPFLAGS = $(OCFS2_DEFINES) $(OCFS2_INCLUDES) fscat_driver.ocfs2: $(FSCAT_DRIVER_OCFS2_OBJS) $(FSCAT_NATIVE_OBJS) $(LINK) $(OCFS2_LIBS) $(COM_ERR_LIBS) Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2007-09-04 19:00:03 UTC (rev 68) +++ trunk/configure.in 2007-09-04 19:02:17 UTC (rev 69) @@ -86,16 +86,12 @@ AC_MSG_ERROR([Unable to find com_err headers])) AC_SUBST(COM_ERR_LIBS) -AC_ARG_WITH([ocfs2-tools], [ --with-ocfs2-tools=PATH directory with compiled ocfs2-tools source], OCFS2_TOOLS_PATH=$withval, OCFS2_TOOLS_PATH="") +dnl AC_ARG_WITH([ocfs2-tools], [ --with-ocfs2-tools=PATH directory with compiled ocfs2-tools source], OCFS2_TOOLS_PATH=$withval, OCFS2_TOOLS_PATH="") -oldldflags="$LDFLAGS" -oldcppflags="$CPPFLAGS" oldlibs="$LIBS" -CPPFLAGS="$CPPFLAGS -DO2CB_FLAT_INCLUDES -DO2DLM_FLAT_INCLUDES -DOCFS2_FLAT_INCLUDES -I${OCFS2_TOOLS_PATH}/libocfs2/include -I${OCFS2_TOOLS_PATH}/libo2dlm/include -I${OCFS2_TOOLS_PATH}/libo2cb/include" -LDFLAGS="$LDFLAGS -L${OCFS2_TOOLS_PATH}/libocfs2 -L${OCFS2_TOOLS_PATH}/libo2dlm -L${OCFS2_TOOLS_PATH}/libo2cb" LIBS="-locfs2 -lo2dlm -lo2cb ${COM_ERR_LIBS}" AC_MSG_CHECKING(for OCFS2 libraries) -AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include "ocfs2.h"]], +AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include ]], [[ initialize_ocfs_error_table(); initialize_o2dl_error_table(); @@ -109,10 +105,12 @@ AC_MSG_RESULT(no) ENABLE_OCFS2= ]) -CPPFLAGS="$oldcppflags" -LDFLAGS="$oldldflags" +if test "x$ENABLE_OCFS2" = "xyes"; then + AC_CHECK_FUNCS([ocfs2_extent_map_init, io_init_cache]) +fi + LIBS="$oldlibs" -AC_SUBST(OCFS2_TOOLS_PATH) +dnl AC_SUBST(OCFS2_TOOLS_PATH) AC_SUBST(ENABLE_OCFS2) AC_CHECK_LIB(ext2fs, ext2fs_open, Modified: trunk/ocfs2.c =================================================================== --- trunk/ocfs2.c 2007-09-04 19:00:03 UTC (rev 68) +++ trunk/ocfs2.c 2007-09-04 19:02:17 UTC (rev 69) @@ -35,7 +35,7 @@ #include #include "native.h" -#include "ocfs2.h" +#include #define PROGNAME "fscat_driver.ocfs2" @@ -266,9 +266,10 @@ uint64_t offset = 0; uint64_t i_size = ci->ci_inode->i_size; int buf_len = (1024 * 1024); /* 1MB is a nice buffer */ - int count; + uint32_t count; char *buf; +#if HAVE_OCFS2_EXTENT_MAP_INIT ret = ocfs2_extent_map_init(fs, ci); if (ret) { com_err(PROGNAME, ret, @@ -276,6 +277,7 @@ ci->ci_blkno); return -EIO; } +#endif count = ocfs2_blocks_in_bytes(fs, buf_len); @@ -319,9 +321,10 @@ uint64_t offset = 0; uint64_t i_size = ci->ci_inode->i_size; int buf_len = PATH_MAX; - int count; + uint32_t count; char *buf; +#if HAVE_OCFS2_EXTENT_MAP_INIT ret = ocfs2_extent_map_init(fs, ci); if (ret) { com_err(PROGNAME, ret, @@ -329,6 +332,7 @@ ci->ci_blkno); return -EIO; } +#endif count = ocfs2_blocks_in_bytes(fs, buf_len); @@ -362,7 +366,7 @@ ocfs2_cached_inode *ci) { int rc = 0; - ocfs2_dinode *di = ci->ci_inode; + struct ocfs2_dinode *di = ci->ci_inode; if (di->i_clusters) { rc = dump_link(inode, fs, ci); @@ -393,7 +397,7 @@ int mode; errcode_t ret; ocfs2_cached_inode *ci = NULL; - ocfs2_dinode *di; + struct ocfs2_dinode *di; ret = ocfs2_read_cached_inode(fs, inode->i_ino, &ci); if (ret) { @@ -568,6 +572,17 @@ goto out; } +#if HAVE_IO_INIT_CACHE + ret = io_init_cache(fs->fs_io, 100); + if (ret) { + rc = -ENOMEM; + com_err(PROGNAME, ret, + "while initializing I/O cache"); + ocfs2_close(fs); + goto out; + } +#endif + switch (op) { case OP_LIST: rc = list_files(fs);