Hello community, here is the log from the commit of package f2fs-tools for openSUSE:Factory checked in at 2013-12-02 07:22:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/f2fs-tools (Old) and /work/SRC/openSUSE:Factory/.f2fs-tools.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "f2fs-tools" Changes: -------- --- /work/SRC/openSUSE:Factory/f2fs-tools/f2fs-tools.changes 2013-08-12 10:16:17.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.f2fs-tools.new/f2fs-tools.changes 2013-12-02 07:22:17.000000000 +0100 @@ -1,0 +2,11 @@ +Sun Nov 24 11:34:03 UTC 2013 - jengelh@inai.de + +- Update to new upstream release 1.2.0 +* f2fs-tools: add stat information into fibmap +* fibmap.f2fs: change fibmap to fibmap.f2fs +* fsck, lib: support inline xattr +* fsck: skip to check block addresses in device files +* fsck: fix to handle file types correctly +* fsck: fix checking orphan inodes + +------------------------------------------------------------------- Old: ---- f2fs-tools-1.1.0+git40.tar.xz New: ---- f2fs-tools-1.2.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ f2fs-tools.spec ++++++ --- /var/tmp/diff_new_pack.Ueol9Q/_old 2013-12-02 07:22:17.000000000 +0100 +++ /var/tmp/diff_new_pack.Ueol9Q/_new 2013-12-02 07:22:17.000000000 +0100 @@ -18,14 +18,14 @@ Name: f2fs-tools %define lname libf2fs0 -Version: 1.1.0+git40 +Version: 1.2.0 Release: 0 -#Snapshot: 6e8f2d5d222eff0abea4b5c0abc7433834094924 Summary: Utilities for the Flash-friendly Filesystem (F2FS) License: GPL-2.0 Group: System/Filesystems Url: http://f2fs-tools.sf.net/_(disused) +#Snapshot: v1.2.0 #Git-Clone: git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools #DL-URL: no tarballs provided Source: %name-%version.tar.xz @@ -53,8 +53,6 @@ make install DESTDIR="$b" sbindir="%_sbindir" # The devel file is quite useless ATM without public headers. rm -f "$b/%_libdir"/*.{la,so} -# /usr/sbin/filefrag already does what fibmap can do. -rm -f "$b/%_sbindir/fibmap" %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -62,6 +60,7 @@ %files %defattr(-,root,root) %_sbindir/dump.f2fs +%_sbindir/fibmap.f2fs %_sbindir/fsck.f2fs %_sbindir/mkfs.f2fs %_libdir/libf2fs.so.0* ++++++ f2fs-tools-1.1.0+git40.tar.xz -> f2fs-tools-1.2.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/README new/f2fs-tools/README --- old/f2fs-tools/README 2013-06-18 03:56:41.000000000 +0200 +++ new/f2fs-tools/README 2013-11-24 12:32:49.000000000 +0100 @@ -25,6 +25,20 @@ # ./configure # make +How to cross-compile (e.g., for ARM) +------------------------------------ + + 1. Add the below line into mkfs/Makefile.am: + mkfs_f2fs_LDFLAGS = -all-static + + 2. Add the below line into fsck/Makefile.am: + fsck_f2fs_LDFLAGS = -all-static + + 3. then, do: + # LDFLAGS=--static ./configure \ + --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi + # make + How to run by default --------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/VERSION new/f2fs-tools/VERSION --- old/f2fs-tools/VERSION 2013-06-18 03:56:41.000000000 +0200 +++ new/f2fs-tools/VERSION 2013-11-24 12:32:49.000000000 +0100 @@ -1,2 +1,2 @@ -1.1.0 -2012-11-29 +1.2.0 +2013-10-25 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/configure new/f2fs-tools/configure --- old/f2fs-tools/configure 2013-08-08 00:15:50.000000000 +0200 +++ new/f2fs-tools/configure 2013-11-24 12:35:46.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for F2FS tools 1.1.0. +# Generated by GNU Autoconf 2.69 for F2FS tools 1.2.0. # # Report bugs to <linux-f2fs-devel@lists.sourceforge.net>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='F2FS tools' PACKAGE_TARNAME='f2fs-tools' -PACKAGE_VERSION='1.1.0' -PACKAGE_STRING='F2FS tools 1.1.0' +PACKAGE_VERSION='1.2.0' +PACKAGE_STRING='F2FS tools 1.2.0' PACKAGE_BUGREPORT='linux-f2fs-devel@lists.sourceforge.net' PACKAGE_URL='' @@ -1324,7 +1324,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures F2FS tools 1.1.0 to adapt to many kinds of systems. +\`configure' configures F2FS tools 1.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1394,7 +1394,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of F2FS tools 1.1.0:";; + short | recursive ) echo "Configuration of F2FS tools 1.2.0:";; esac cat <<\_ACEOF @@ -1508,7 +1508,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -F2FS tools configure 1.1.0 +F2FS tools configure 1.2.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2007,7 +2007,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by F2FS tools $as_me 1.1.0, which was +It was created by F2FS tools $as_me 1.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2366,13 +2366,13 @@ -$as_echo "#define F2FS_TOOLS_VERSION \"1.1.0\"" >>confdefs.h +$as_echo "#define F2FS_TOOLS_VERSION \"1.2.0\"" >>confdefs.h $as_echo "#define F2FS_MAJOR_VERSION 1" >>confdefs.h -$as_echo "#define F2FS_MINOR_VERSION 1" >>confdefs.h +$as_echo "#define F2FS_MINOR_VERSION 2" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for .git" >&5 @@ -2392,11 +2392,11 @@ $as_echo "$ac_cv_file__git" >&6; } if test "x$ac_cv_file__git" = xyes; then : -$as_echo "#define F2FS_TOOLS_DATE \"2013-08-07\"" >>confdefs.h +$as_echo "#define F2FS_TOOLS_DATE \"\"" >>confdefs.h else -$as_echo "#define F2FS_TOOLS_DATE \"2012-11-29\"" >>confdefs.h +$as_echo "#define F2FS_TOOLS_DATE \"2013-10-25\"" >>confdefs.h fi @@ -2881,7 +2881,7 @@ # Define the identity of the package. PACKAGE='f2fs-tools' - VERSION='1.1.0' + VERSION='1.2.0' cat >>confdefs.h <<_ACEOF @@ -13286,7 +13286,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by F2FS tools $as_me 1.1.0, which was +This file was extended by F2FS tools $as_me 1.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13352,7 +13352,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -F2FS tools config.status 1.1.0 +F2FS tools config.status 1.2.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/fsck/Makefile.am new/f2fs-tools/fsck/Makefile.am --- old/f2fs-tools/fsck/Makefile.am 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/fsck/Makefile.am 2013-11-24 12:32:49.000000000 +0100 @@ -2,11 +2,11 @@ AM_CPPFLAGS = ${libuuid_CFLAGS} -I$(top_srcdir)/include AM_CFLAGS = -Wall -sbin_PROGRAMS = fsck.f2fs fibmap +sbin_PROGRAMS = fsck.f2fs fibmap.f2fs fsck_f2fs_SOURCES = main.c fsck.c dump.c mount.c fsck_f2fs_LDADD = ${libuuid_LIBS} $(top_builddir)/lib/libf2fs.la -fibmap_SOURCES = fibmap.c +fibmap_f2fs_SOURCES = fibmap.c install-data-hook: ln -sf fsck.f2fs $(DESTDIR)/$(sbindir)/dump.f2fs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/fsck/Makefile.in new/f2fs-tools/fsck/Makefile.in --- old/f2fs-tools/fsck/Makefile.in 2013-08-08 00:15:54.000000000 +0200 +++ new/f2fs-tools/fsck/Makefile.in 2013-11-24 12:35:48.000000000 +0100 @@ -50,7 +50,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -sbin_PROGRAMS = fsck.f2fs$(EXEEXT) fibmap$(EXEEXT) +sbin_PROGRAMS = fsck.f2fs$(EXEEXT) fibmap.f2fs$(EXEEXT) subdir = fsck DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp @@ -67,9 +67,9 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) -am_fibmap_OBJECTS = fibmap.$(OBJEXT) -fibmap_OBJECTS = $(am_fibmap_OBJECTS) -fibmap_LDADD = $(LDADD) +am_fibmap_f2fs_OBJECTS = fibmap.$(OBJEXT) +fibmap_f2fs_OBJECTS = $(am_fibmap_f2fs_OBJECTS) +fibmap_f2fs_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -105,8 +105,8 @@ AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(fibmap_SOURCES) $(fsck_f2fs_SOURCES) -DIST_SOURCES = $(fibmap_SOURCES) $(fsck_f2fs_SOURCES) +SOURCES = $(fibmap_f2fs_SOURCES) $(fsck_f2fs_SOURCES) +DIST_SOURCES = $(fibmap_f2fs_SOURCES) $(fsck_f2fs_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -239,7 +239,7 @@ AM_CFLAGS = -Wall fsck_f2fs_SOURCES = main.c fsck.c dump.c mount.c fsck_f2fs_LDADD = ${libuuid_LIBS} $(top_builddir)/lib/libf2fs.la -fibmap_SOURCES = fibmap.c +fibmap_f2fs_SOURCES = fibmap.c all: all-am .SUFFIXES: @@ -320,9 +320,9 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -fibmap$(EXEEXT): $(fibmap_OBJECTS) $(fibmap_DEPENDENCIES) $(EXTRA_fibmap_DEPENDENCIES) - @rm -f fibmap$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(fibmap_OBJECTS) $(fibmap_LDADD) $(LIBS) +fibmap.f2fs$(EXEEXT): $(fibmap_f2fs_OBJECTS) $(fibmap_f2fs_DEPENDENCIES) $(EXTRA_fibmap_f2fs_DEPENDENCIES) + @rm -f fibmap.f2fs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fibmap_f2fs_OBJECTS) $(fibmap_f2fs_LDADD) $(LIBS) fsck.f2fs$(EXEEXT): $(fsck_f2fs_OBJECTS) $(fsck_f2fs_DEPENDENCIES) $(EXTRA_fsck_f2fs_DEPENDENCIES) @rm -f fsck.f2fs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fsck_f2fs_OBJECTS) $(fsck_f2fs_LDADD) $(LIBS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/fsck/fibmap.c new/f2fs-tools/fsck/fibmap.c --- old/f2fs-tools/fsck/fibmap.c 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/fsck/fibmap.c 2013-11-24 12:32:49.000000000 +0100 @@ -26,6 +26,21 @@ ext->end_blk, ext->blk_count); } +void print_stat(struct stat64 *st) +{ + printf("--------------------------------------------\n"); + printf("dev [%d:%d]\n", major(st->st_dev), minor(st->st_dev)); + printf("ino [0x%8lx : %ld]\n", st->st_ino, st->st_ino); + printf("mode [0x%8x : %d]\n", st->st_mode, st->st_mode); + printf("nlink [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink); + printf("uid [0x%8x : %d]\n", st->st_uid, st->st_uid); + printf("gid [0x%8x : %d]\n", st->st_gid, st->st_gid); + printf("size [0x%8lx : %ld]\n", st->st_size, st->st_size); + printf("blksize [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize); + printf("blocks [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks); + printf("--------------------------------------------\n\n"); +} + int main(int argc, char *argv[]) { int fd; @@ -61,6 +76,7 @@ total_blks = (st.st_size + st.st_blksize - 1) / st.st_blksize; printf("\n%s :\n", filename); + print_stat(&st); printf("file_pos start_blk end_blk blks\n"); blknum = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/fsck/fsck.c new/f2fs-tools/fsck/fsck.c --- old/f2fs-tools/fsck/fsck.c 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/fsck/fsck.c 2013-11-24 12:34:59.000000000 +0100 @@ -10,6 +10,17 @@ */ #include "fsck.h" +#define S_SHIFT 12 +static unsigned char f2fs_type_by_mode[S_IFMT >> S_SHIFT] = { + [S_IFREG >> S_SHIFT] = F2FS_FT_REG_FILE, + [S_IFDIR >> S_SHIFT] = F2FS_FT_DIR, + [S_IFCHR >> S_SHIFT] = F2FS_FT_CHRDEV, + [S_IFBLK >> S_SHIFT] = F2FS_FT_BLKDEV, + [S_IFIFO >> S_SHIFT] = F2FS_FT_FIFO, + [S_IFSOCK >> S_SHIFT] = F2FS_FT_SOCK, + [S_IFLNK >> S_SHIFT] = F2FS_FT_SYMLINK, +}; + char *tree_mark; int tree_mark_size = 256; @@ -258,7 +269,6 @@ return 0; } - int fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid, enum FILE_TYPE ftype, @@ -281,18 +291,13 @@ fsck->chk.valid_inode_cnt++; /* Orphan node. i_links should be 0 */ - if (ftype & F2FS_FT_ORPHAN) { + if (ftype == F2FS_FT_ORPHAN) { ASSERT(i_links == 0); - - if (S_ISDIR(le16_to_cpu(node_blk->i.i_mode))) - ftype |= F2FS_FT_DIR; - else - ftype |= F2FS_FT_REG_FILE; } else { ASSERT(i_links > 0); } - if (ftype & F2FS_FT_DIR) { + if (ftype == F2FS_FT_DIR) { /* not included '.' & '..' */ if (f2fs_test_bit(BLKOFF_FROM_MAIN(sbi, ni->blk_addr), fsck->main_area_bitmap) != 0) { @@ -301,7 +306,7 @@ } f2fs_set_bit(BLKOFF_FROM_MAIN(sbi, ni->blk_addr), fsck->main_area_bitmap); - } else if (ftype & F2FS_FT_REG_FILE) { + } else { if (f2fs_test_bit(BLKOFF_FROM_MAIN(sbi, ni->blk_addr), fsck->main_area_bitmap) == 0x0) { f2fs_set_bit(BLKOFF_FROM_MAIN(sbi, ni->blk_addr), fsck->main_area_bitmap); @@ -325,16 +330,17 @@ /* No need to go deep into the node */ goto out; - } - } else { - ASSERT(0); } fsck_chk_xattr_blk(sbi, nid, le32_to_cpu(node_blk->i.i_xattr_nid), blk_cnt); + if (ftype == F2FS_FT_CHRDEV || ftype == F2FS_FT_BLKDEV || + ftype == F2FS_FT_FIFO || ftype == F2FS_FT_SOCK) + goto check; + /* check data blocks in inode */ - for (idx = 0; idx < ADDRS_PER_INODE; idx++) { + for (idx = 0; idx < ADDRS_PER_INODE(&node_blk->i); idx++) { if (le32_to_cpu(node_blk->i.i_addr[idx]) != 0) { *blk_cnt = *blk_cnt + 1; ret = fsck_chk_data_blk(sbi, @@ -373,12 +379,16 @@ ASSERT(ret >= 0); } } - - if (ftype & F2FS_FT_DIR) +check: + if (ftype == F2FS_FT_DIR) DBG(1, "Directory Inode: ino: %x name: %s depth: %d child files: %d\n\n", le32_to_cpu(node_blk->footer.ino), node_blk->i.i_name, le32_to_cpu(node_blk->i.i_current_depth), child_files); - if ((ftype & F2FS_FT_DIR && i_links != child_cnt) || + if (ftype == F2FS_FT_ORPHAN) + DBG(1, "Orphan Inode: ino: %x name: %s i_blocks: %d\n\n", + le32_to_cpu(node_blk->footer.ino), node_blk->i.i_name, + i_blocks); + if ((ftype == F2FS_FT_DIR && i_links != child_cnt) || (i_blocks != *blk_cnt)) { print_node_info(node_blk); DBG(1, "blk cnt [0x%x]\n", *blk_cnt); @@ -386,7 +396,7 @@ } ASSERT(i_blocks == *blk_cnt); - if (ftype & F2FS_FT_DIR) + if (ftype == F2FS_FT_DIR) ASSERT(i_links == child_cnt); out: return 0; @@ -549,12 +559,11 @@ hash_code = f2fs_dentry_hash((const char *)name, name_len); ASSERT(le32_to_cpu(de_blk->dentry[i].hash_code) == hash_code); - ftype = F2FS_FT_REG_FILE; + ftype = de_blk->dentry[i].file_type; /* Becareful. 'dentry.file_type' is not imode. */ - if (de_blk->dentry[i].file_type == F2FS_FT_DIR) { + if (ftype == F2FS_FT_DIR) { *child_cnt = *child_cnt + 1; - ftype = F2FS_FT_DIR; if ((name[0] == '.' && name[1] == '.' && name_len == 2) || (name[0] == '.' && name_len == 1)) { i++; @@ -606,6 +615,7 @@ u8 ver) { struct f2fs_fsck *fsck = F2FS_FSCK(sbi); + /* Is it reserved block? */ if (blk_addr == NEW_ADDR) { fsck->chk.valid_blk_cnt++; @@ -628,7 +638,7 @@ fsck->chk.valid_blk_cnt++; - if ((ftype & F2FS_FT_DIR) && !(ftype & F2FS_FT_ORPHAN)) { + if (ftype == F2FS_FT_DIR) { fsck_chk_dentry_blk(sbi, inode, blk_addr, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/fsck/mount.c new/f2fs-tools/fsck/mount.c --- old/f2fs-tools/fsck/mount.c 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/fsck/mount.c 2013-11-24 12:32:49.000000000 +0100 @@ -51,7 +51,7 @@ DISP_u32(inode, i_addr[2]); /* Pointers to data blocks */ DISP_u32(inode, i_addr[3]); /* Pointers to data blocks */ - for (i = 4; i < ADDRS_PER_INODE; i++) { + for (i = 4; i < ADDRS_PER_INODE(inode); i++) { if (inode->i_addr[i] != 0x0) { printf("i_addr[0x%x] points data block\r\t\t\t\t[0x%4x]\n", i, inode->i_addr[i]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/include/f2fs_fs.h new/f2fs-tools/include/f2fs_fs.h --- old/f2fs-tools/include/f2fs_fs.h 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/include/f2fs_fs.h 2013-11-24 12:32:49.000000000 +0100 @@ -346,14 +346,25 @@ } __attribute__((packed)); #define F2FS_NAME_LEN 255 -#define ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ +#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs */ +#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ +#define ADDRS_PER_INODE(fi) addrs_per_inode(fi) #define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ #define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ +#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1) +#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2) +#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3) +#define NODE_IND2_BLOCK (DEF_ADDRS_PER_INODE + 4) +#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) + +#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ +#define F2FS_INLINE_DATA 0x02 /* file inline data flag */ + struct f2fs_inode { __le16 i_mode; /* file mode */ __u8 i_advise; /* file hints */ - __u8 i_reserved; /* reserved */ + __u8 i_inline; /* file inline flags */ __le32 i_uid; /* user ID */ __le32 i_gid; /* group ID */ __le32 i_links; /* links count */ @@ -376,7 +387,7 @@ struct f2fs_extent i_ext; /* caching a largest extent */ - __le32 i_addr[ADDRS_PER_INODE]; /* Pointers to data blocks */ + __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */ __le32 i_nid[5]; /* direct(2), indirect(2), double_indirect(1) node id */ @@ -607,16 +618,16 @@ /* file types used in inode_info->flags */ enum FILE_TYPE { F2FS_FT_UNKNOWN, - F2FS_FT_REG_FILE = 0x1, - F2FS_FT_DIR = 0x2, - F2FS_FT_CHRDEV = 0x4, - F2FS_FT_BLKDEV = 0x8, - F2FS_FT_FIFO = 0x10, - F2FS_FT_SOCK = 0x20, - F2FS_FT_SYMLINK = 0x40, - F2FS_FT_MAX = 0x80, + F2FS_FT_REG_FILE, + F2FS_FT_DIR, + F2FS_FT_CHRDEV, + F2FS_FT_BLKDEV, + F2FS_FT_FIFO, + F2FS_FT_SOCK, + F2FS_FT_SYMLINK, + F2FS_FT_MAX, /* added for fsck */ - F2FS_FT_ORPHAN = 0x1000, + F2FS_FT_ORPHAN, }; /* from f2fs/segment.h */ @@ -627,6 +638,7 @@ extern void ASCIIToUNICODE(u_int16_t *, u_int8_t *); extern int log_base_2(u_int32_t); +extern unsigned int addrs_per_inode(struct f2fs_inode *); extern int get_bits_in_byte(unsigned char n); extern int set_bit(unsigned int nr,void * addr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/lib/libf2fs.c new/f2fs-tools/lib/libf2fs.c --- old/f2fs-tools/lib/libf2fs.c 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/lib/libf2fs.c 2013-11-24 12:32:49.000000000 +0100 @@ -315,6 +315,13 @@ return f2fs_hash; } +unsigned int addrs_per_inode(struct f2fs_inode *i) +{ + if (i->i_inline & F2FS_INLINE_XATTR) + return DEF_ADDRS_PER_INODE - F2FS_INLINE_XATTR_ADDRS; + return DEF_ADDRS_PER_INODE; +} + /* * CRC32 */ @@ -364,6 +371,7 @@ c->heap = 1; c->vol_label = ""; c->device_name = NULL; + c->trim = 1; } static int is_mounted(const char *mpt, const char *device) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/mkfs/f2fs_format.c new/f2fs-tools/mkfs/f2fs_format.c --- old/f2fs-tools/mkfs/f2fs_format.c 2013-08-08 00:14:42.000000000 +0200 +++ new/f2fs-tools/mkfs/f2fs_format.c 2013-11-24 12:34:59.000000000 +0100 @@ -130,6 +130,8 @@ "mpe", "rm", "ogg", + "jpeg", + "video", "apk", /* for android system */ NULL }; @@ -917,6 +919,7 @@ return -1; } + MSG(0, "Info: Discarding device\n"); if (S_ISREG(stat_buf.st_mode)) return 0; else if (S_ISBLK(stat_buf.st_mode)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/scripts/dumpf2fs.sh new/f2fs-tools/scripts/dumpf2fs.sh --- old/f2fs-tools/scripts/dumpf2fs.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/f2fs-tools/scripts/dumpf2fs.sh 2013-11-24 12:32:49.000000000 +0100 @@ -0,0 +1,61 @@ +#!/system/bin/sh +DEV=/dev/block/mmcblk0p16 + +CMD=$1 +BASE=0x200000 +BASE_MAIN=0xac00000 + +case $CMD in +cp1) + echo dump cp1 + let addr=$BASE + echo $addr + hexdump -s $addr -n 4096 $DEV;; +cp2) + echo dump cp2 + let addr=$BASE+0x200000 + hexdump -s $addr -n 4096 $DEV;; +cp) + echo dump cp1 and cp2 + let addr=$BASE + hexdump -s $addr -n 409 $DEV + let addr=$BASE+0x200000 + hexdump -s $addr -n 4096 $DEV;; +cp1_all) + echo dump cp1 all + let addr=$BASE + hexdump -s $addr -n 20480 $DEV;; +cp2_all) + echo dump cp2 all + let addr=$BASE+0x200000 + hexdump -s $addr -n 20480 $DEV;; +cp_all) + echo dump cp1 and cp2 all + let addr=$BASE + hexdump -s $addr -n 20480 $DEV + let addr=$BASE+0x200000 + hexdump -s $addr -n 20480 $DEV;; +blk) + let addr=$BASE_MAIN+$2*0x200000+$3*0x1000 + hexdump -s $addr -n 4096 $DEV + echo ;; +inode) + let addr=$BASE_MAIN+$2*0x200000+$3*0x1000 + for i in `seq $3 511` + do + hexdump -s $addr -n 8 $DEV + let end=$addr+0x0ff0 + hexdump -s $end -n 16 $DEV + let addr=$addr+0x1000 + done + echo ;; +*) + let addr=$1*0x1000 + let segno=$addr-$BASE_MAIN + let segno=$segno/0x200000 + let off=$addr-$BASE_MAIN + let off=$off%0x200000/0x1000 + echo $segno, $off + hexdump -s $addr -n 4096 $DEV + echo ;; +esac diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/scripts/spo_test.sh new/f2fs-tools/scripts/spo_test.sh --- old/f2fs-tools/scripts/spo_test.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/f2fs-tools/scripts/spo_test.sh 2013-11-24 12:32:49.000000000 +0100 @@ -0,0 +1,70 @@ +#!/bin/bash + +MNT=/mnt/f2fs +DEV=/dev/sdb1 +USER_DIR=/home/zeus +F2FS_DIR=$USER_DIR/f2fs_test + +check_stop() { + stop=`cat /tmp/stop` + if [ $stop -eq 1 ]; then + exit + fi +} + +case $1 in +start) + echo 0 > /tmp/stop + umount /mnt/* + echo 3 > /proc/sys/vm/drop_caches + echo 8 > /proc/sys/kernel/printk + + date >> $USER_DIR/por_result + sync + + insmod $F2FS_DIR/src/fs/f2fs/f2fs.ko || exit + + echo Start checking F2FS without fsync + check_stop + fsck.f2fs $DEV -d 0 || exit + mount -t f2fs -o disable_roll_forward $DEV $MNT || exit + umount $MNT + echo 3 > /proc/sys/vm/drop_caches + + echo Start checking F2FS with fsync + check_stop + fsck.f2fs $DEV -d 0 || exit + mount -t f2fs $DEV $MNT || exit + umount $MNT + + check_stop + fsck.f2fs $DEV -d 0 || exit + mount -t f2fs $DEV $MNT || exit + + count=`cat $USER_DIR/por_time` + if [ $count -eq 20 ]; then + echo Start rm all + time rm -rf $MNT/* || exit + echo 0 > $USER_DIR/por_time + sync + else + echo $((count+1)) > $USER_DIR/por_time + fi + echo 8 > /proc/sys/kernel/printk + echo Start fsstress + date + $F2FS_DIR/stress_test/fsstress/fsstress -z -f link=0 -f mkdir=3 -f mknod=3 -f rmdir=2 -f symlink=3 -f truncate=4 -f write=10 -f creat=10 -f unlink=5 -f rename=5 -f fsync=10 -p 10 -n 10000 -l 0 -d $MNT & + RANDOM=`date '+%s'` + rand=$[($RANDOM % 540) + 60] + echo Start sleep: $rand seconds + sleep $rand + + echo Reboot now + check_stop + echo b > /proc/sysrq-trigger + ;; +stop) + killall -9 fsstress + echo 1 > /tmp/stop + ;; +esac diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/f2fs-tools/scripts/tracepoint.sh new/f2fs-tools/scripts/tracepoint.sh --- old/f2fs-tools/scripts/tracepoint.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/f2fs-tools/scripts/tracepoint.sh 2013-11-24 12:32:49.000000000 +0100 @@ -0,0 +1,59 @@ +#!/bin/bash + +TRACE=/sys/kernel/debug/tracing/ +dev=$(((8<<20) + 17)) # sdb1 (8,17) + +echo 1 > tracing_on + +# block tracepoints +echo "dev == $dev" > $TRACE/events/block/block_rq_complete/filter +echo 1 > $TRACE/events/block/block_rq_complete/enable +echo 0 > $TRACE/events/block/block_bio_complete/enable + +# GC +G=0 +echo $G > $TRACE/events/f2fs/f2fs_get_victim/enable + +# block allocation +A=0 +echo $A > $TRACE/events/f2fs/f2fs_reserve_new_block/enable + +# block truncation +T=0 +echo $T > $TRACE/events/f2fs/f2fs_truncate/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_inode_blocks_enter/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_inode_blocks_exit/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_blocks_enter/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_blocks_exit/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_nodes_enter/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_nodes_exit/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_data_blocks_range/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_node/enable +echo $T > $TRACE/events/f2fs/f2fs_truncate_partial_nodes/enable + +# syscalls +S=0 +echo $S > $TRACE/events/f2fs/f2fs_unlink_enter/enable +echo $S > $TRACE/events/f2fs/f2fs_unlink_exit/enable +echo $S > $TRACE/events/f2fs/f2fs_fallocate/enable +echo $S > $TRACE/events/f2fs/f2fs_get_data_block/enable + +# IOs +R=0 +W=0 +echo $W > $TRACE/events/f2fs/f2fs_submit_write_page/enable +echo $W > $TRACE/events/f2fs/f2fs_do_submit_bio/enable +echo $R > $TRACE/events/f2fs/f2fs_readpage/enable + +# VFS interfaces +V=0 +echo $V > $TRACE/events/f2fs/f2fs_iget/enable +echo $V > $TRACE/events/f2fs/f2fs_iget_exit/enable +echo $V > $TRACE/events/f2fs/f2fs_new_inode/enable +echo $V > $TRACE/events/f2fs/f2fs_evict_inode/enable +echo $V > $TRACE/events/f2fs/f2fs_sync_file_enter/enable +echo $V > $TRACE/events/f2fs/f2fs_sync_file_exit/enable +echo $V > $TRACE/events/f2fs/f2fs_write_checkpoint/enable +echo $V > $TRACE/events/f2fs/f2fs_sync_fs/enable + +cat $TRACE/trace_pipe -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org