Commit Graph

983 Commits

Author SHA1 Message Date
Jaegeuk Kim
1dc688d2fd build: revert "Compile static by default"
By default, we should use dynamic linking.
If anyone need to build 100% statically, add -all-static.

This reverts commit 2eb19102d4c5bec57c04c944ee697584a493ef9c.
2013-04-04 09:19:30 +09:00
Jaegeuk Kim
f5f440f086 build: change f2fs_fs.h
Let's sync f2fs_fs.h in the kernel source tree.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:19:25 +09:00
Jaegeuk Kim
e1e843d29c build: compile static by default
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:19:19 +09:00
Jaegeuk Kim
5043dffbd1 build: clean up the base functions
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:19:15 +09:00
Jaegeuk Kim
e69e437850 build: make several base functions as a library
Let's make a library and relocate functions for other tools like fsck.f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:19:07 +09:00
Jaegeuk Kim
2784bd55dd build: sync f2fs_fs.h with current f2fs sources
Rearrange positions of all the data structures for easy synchronization between
f2fs-tools and f2fs kernel sources.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:19:01 +09:00
Jaegeuk Kim
40b9f96587 build: move f2fs_format.h to ../include/f2fs_fs.h
This is to use f2fs.h globally, which will be used by other tools such as
fsck.f2fs.

Siged-mff-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:18:55 +09:00
Jaegeuk Kim
28af021c91 build: add description of prerequisite to build
Let's check two more packages before building f2fs-tools.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:18:45 +09:00
Jaegeuk Kim
d2387723a8 mkfs: reserve x2 sections
This is due to GC on data sections.
When a data section is cleaned, it produces maximum same number of dirty node
blocks additionally.
So, we should reserve x2 sections to flush dirty node blocks safely.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-04-04 09:18:34 +09:00
Jan Engelhardt
c7e0a01375 build: place mkfs into sbindir
Filesystem creation utilities have always been in *sbin*.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 04:05:07 +01:00
Jan Engelhardt
8471b6a200 build: replace obsolete build macros
AM_CONFIG_HEADER is obsolete. Since v1.6.1b(!) already.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 03:59:16 +01:00
Jan Engelhardt
2a8c4b1373 build: set some automake options
Use "foreign", so that we are not forced to have all files GNU
requires. It also gets us rid of the INSTALL boilerplate.

Use tar-pax dist-xz to select a modern compression scheme.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 03:58:17 +01:00
Jan Engelhardt
ec1a5da788 build: make use of AC_CONFIG_AUX_DIR
Place most of the autogenerated files in a separate directory that can
be ignored wholesale, thereby reducing files in the top-level
directory.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 03:56:12 +01:00
Jan Engelhardt
abb6bb88bc Update .gitignore
Mark directories to be ignored as such.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 03:54:28 +01:00
Jan Engelhardt
fe2928a793 build: use pkgconfig to determine libuuid's parameters
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 03:53:28 +01:00
Jan Engelhardt
b1bce4d3b7 build: remove unnecessary m4_flatten
automake can cope with it as-is.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-12-12 03:52:24 +01:00
Ezequiel Garcia
07b815d395 mkfs: Make HDIO_GETGEO ioctl optional
Some block devices don't implement HDIO_GETGEP ioctl;
loop device being a notable example.
Without this patch, it's not possible to make a f2fs
on a file mounted over a loop device.

Signed-off-by: Ezequiel Garcia <ezequiel@free-electrons.com>
2012-12-12 11:17:34 +09:00
Sven-Göran Bergh
807776acbf More files git should ignore
Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org>
2012-12-10 08:38:56 +09:00
Sven-Göran Bergh
dd1ba078fa Unify version and date management
Patch 1:
 Now we have two different versions that produce different superblocks/
 filesystems with the same version info. Major/minor version in the sb
 should reflect the version of the tool creating the filesystem. This
 patch will ensure that the version entered in the file VERSION will
 be used consistently throughout the code.

Patch 2:
 In order to simplify the maintenance with a new release the date
 in F2FS_TOOLS_DATE is now take from the last commit in git. Thus,
 git is needed to run autoconf. However, git is not needed for the
 simple build procedure, ./configure && make, that should be the
 only things needed to build the tool from a tar.gz package.

 Pros & Cons:
  [+] Automated
  [+] True
  [-] Git needed to run autoreconf

Change log by Jaegeuk from the initial patch-set:

- Merge two patches into one
 : Eliminate the intermediate state having version.h and VERSION.

- Remove the Git dependency which is one of Cons
 : If there is no git tree, just use DATE described in VERSION.

- Minor coding style

 Pros & Cons:
  [+] Automated
  [+] True
  [+] No Git dependency

Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-12-07 14:56:27 +09:00
Sven-Göran Bergh
c0f2b9065c Ignore configure.lineno
Autotools may spit out the file configure.lineno, which git
should ignore as well.

Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org>
2012-12-06 09:42:45 +09:00
Jaegeuk Kim
da59f6146c Sync the version management
For debian packaing, I should have matched the previous verions, v1.1.0.
So, this is the start of f2fs-tools version.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-29 12:44:04 +09:00
Jaegeuk Kim
8bdf26205d Add version information
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 20:04:39 +09:00
Jaegeuk Kim
c6ff6d09de Bug fix: Fix overflow when calculating block address
This patch fixes the bug as follows.
"I'm trying to roll out f2fs on top of SDHC card and faced with following
issue - after mounting card I cannot read device root entry. It returns
-1 EINVAL (entry too big).
getdents(3, /* 1 entries */, 32768)     = 24
getdents(3, 0x1082c88, 32768)           = -1 EINVAL (Invalid argument)"
		reported by Ruslan N. Marchenko [me@ruff.mobi].

This bug is easily reproducible and I couldn't have checked the mount
entry cautiously.
Due to the bug, f2fs couldn't get default dentries, . and .., in the root
directory. In the case of other newly created directories, that's fine.

The problem was the overflow during casting variables while calculating the
block address of the root dentry block.
In order to avoid that, I simply split the equation under consideration of
the casting issue.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
bbf6e62360 Cleanup: sync comments to kernel source
Remove unnecessary data fields too.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
4ed75df379 Bug fix: store superblocks with correct offset
There are two superblock writes in mkfs.f2fs.

offset: 0     1024                 4095      5119                 8191
        |------> 1'st superblock ----|--------> 2'nd superblock ----|

Therefore, each superblocks has 1024 byte-size offset.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Mike Frysinger
0903d1e429 touch up autotools
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-26 19:45:59 +09:00
Mike Frysinger
e12214e836 ignore generated files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-26 19:45:59 +09:00
Mike Frysinger
3dd5f8b400 use proper priu64 type to be portable
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
9db27ee071 Cleanup: add comments
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
22a75edd47 Enhancement: shorten umount time
When f2fs is unmounted cleanly, it stores active summmary blocks of nodes in the
checkpoint pack in order to avoid reconstruct all of them at the later mount
time. Previously, mkfs didn't prepare that, which is why the initial mount time
is so huge.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
99b7439340 Enhancement: add uuid
"Usually, it is used 128-bits UUID for serial number. Why do you use
__le32 as volume_serial_number?"
>From Vyacheslav Dubeyko.

I added an uuid facility for the serial number.
And sync with kernel/include/linux/f2fs_fs.h.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
b5af7953f8 Enhancement: add i_atime and i_generation
"You appear to have dropped i_btime - no big deal, you weren't using it anyway.
However if you ever want to support NFS export you will need some value which
is assigned when the inode is allocated and never changed until it is
de-allocated.  This is used to detect when an NFS file-handle refers to a
previous incarnation of an inode and so should be rejected as STALE.
i_btime could have possibly provided this, but not any more.  You might want
to add something back.
ext3 uses "i_generation" and has an 's_next_generation' in the superblock to
ensure that each new inode gets a new generation number.

You've also dropped i_atime.  I can certainly understand the desire to do
that, but I wonder if it is entirely wise.  There are some use-cases where
i_mtime is a poor substitute.

Also 'current_depth' looks a little odd without a 'i_' prefix.  It wouldn't
hurt to have a comment noting that it is for directories."

>From Neil Brown.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-11-26 19:45:59 +09:00
Jaegeuk Kim
036d45e551 mkfs: Initial commit for patch v2 series
This is same as f2fs-tools-1.1.0.tar.gz, and for patch v2 in kernel.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@gmail.com>
2012-11-26 19:45:59 +09:00