nilfs-utils: Add --print option to mkcp

This patch adds a new option -p|--print to mkcp so that user can know
the CP number it created without checking lscp.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
nilfs2: add omitted comments for structures in nilfs2_fs.h

Add omitted comments for structures in nilfs2_fs.h.

Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
nilfs-utils: mkfs.nilfs2 should check presence of NILFS2 volume on device

The mkfs.nilfs2 utility should check presence of existing file system
or partition table on device and to warn a user about possibility to
destroy data by mkfs activity. This patch uses libblkid library for
detection of presence of file system or partition table on opened
device. If libblkid detects any known signature then mkfs.nilfs2
informs a user about potential danger to destroy existing file system
or partition table. The execution of mkfs.nilfs2 stops with offering
to make decision about continuation or abortion of operation.

Moreover, this patch adds "-f" option that gives opportunity to force
overwrite when an existing file system is detected on the device. By
default, mkfs.nilfs2 will not write to the device if it suspects that
there is a file system on the device already. The man page of
mkfs.nilfs2 was modified by description of "-f" option.

Reported-by: Hendrik Levsen <hendrik@levsen.org>
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Martin Steigerwald <Martin@lichtvoll.de>
Tested-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
README: add libblkid-devel to the list of required packages

The patch "nilfs-utils: mkfs.nilfs2 should check presence of NILFS2
volume on device" (commit c9abe2bf1d40b9a2a22a0fdce340ab839bee6c13)
adds dependency to libblkid-devel (or libblkid-dev) packages.

This describes it in the README file.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
nilfs-utils: add autogen script

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
mkfs.nilfs2: erase first and second sectors unless boot sector exists

There is a filesystem which writes a super block on the first sector
of the device.  One of such filesystems is xfs.  Since the current
mkfs.nilfs2 does not erase the first and the second sectors, blkid can
detect that the partition is used with the old file system even after
mkfs.nilfs2 has formatted the device.

This fixes the issue by erasing the first and the second if boot
sector does not exist on the first sector.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>