Use PRIu32, PRIu64, and PRIcno, which corresponds to the defined type
nilfs_cno_t, for format strings in printf(), etc, and remove type cast
for corresponding arguments if possible.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
The commands under "bin/" output the error messages by themselves by
setting opterr to 0, and are compatible with getopt_long, but if
an invalid long option is specified, the option that causes the error
will not be displayed as shown below:
lscp: invalid option --
Also lscp and lssu do not properly display error messages for options
that require an additional argument and it is not provided.
Fix these issues by not setting opterr to 0 and leaving error output
for argument options to getopt() or getopt_long()'s built-in features.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Update email addresses of NTT developers since lab.ntt.co.jp email
domain has been deprecated due to company policy.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
musl does provide _POSIX_MAX_INPUT, but no MAX_INPUT out of the box.
This commit assigns _POSIX_MAX_INPUT to MAX_INPUT.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Replace __u64, __u32, __u8, __s64, and __s32 with standard uint64_t,
uint32_t, uint8_t, int64_t and int32_t types, respectively, except for
nilfs2_api.h and nilfs2_ondisk.h.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
On-disk summary information of files can fall into inconsistent
states in theory:
- The block count recorded in finfo can exceed the number of
remaining payload blocks.
- The number of data blocks recorded in finfo can be larger than the
number of total blocks of the file, or
- The total size of finfo and binfo structures can exceed the size of
summary information of the partial segment.
This adds sanity checks for these glitches to nilfs_file, and adds a
framework to handle these errors as well.
Also, this enhances the error output routine of dumpseg command to
handle these errors nicely.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The concept of "super file" is very confusing and nonsensical.
Get rid of the term from nilfs-utils.
The term is only used in the name of nilfs_file_is_super() test
function, so this alters the function name.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
On-disk sizes recorded in segment summary header can be too short or
too large.
This adds three errors on sizes related to partial segment:
- partial segment block count
- segment summary header size, and
- segment summary information size
and adds their sanity checks to libsegment.
Also, this enhances the error output routine of dumpseg command to
handle these errors nicely.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Use likely() and unlikely() macros for condition statements
that determine branching to error-handling.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
If ss_bytes, an on-disk segment summary data, stores a value that is
not a multiple of eight, memory access for reading file/block
information can cause a bad alignment exception depending on the
architecture.
To prevent the issue, this introduces an error handling framework to
the psegment iterator, inserts a sanity check in
nilfs_psegment_is_valid() function that detects the bad alignment
condition and reports it with the framework, and applies these changes
to dumpseg command and gc library.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Rewrite nilfs_get_segment() and nilfs_put_segment() so that
nilfs_get_segment() stores related information (segment size, start
block number, number of blocks, memory address, etc) in a new data
structure, nilfs_segment, and nilfs_put_segment() releases the memory
allocated or mapped by nilfs_get_segment() based on the information in
nilfs_segment.
This also simplifies nilfs_psegment struct and functions wrt iterator
for partial segment, that is, nilfs_psegment_init(),
nilfs_psegment_is_end(), nilfs_psegment_next(), and
nilfs_psegment_for_each().
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
64-bit endian conversion macro le64_to_cpu() is wrongly used for
32-bit on-disk data (ss_nblocks) at dumpseg_print_psegment() function.
This fixes the bug.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Add a new header file "segment.h", move definition of segment i/o
routines into it, and move the implementation from libnilfs to a new
internal library libsegment.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Remove copy and paste code snippets related to the number of blocks
per segment that repeatedly appear in lib/nilfs.c and dumpseg.c.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Use nilfs_cnormap API to calculate the minimum checkpoint
number included in a given protection period.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Prevent marking "p" flag on segments that have a future timestamp in
the output of "lssu -l".
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Similar fix with the commit d73631931f4b4849 ("cleanerd: handle
absolute time with signed type variables"). Change type of variables
which are used to store a timestamp value.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix the following style issue regression that checkpatch detected:
"WARNING: braces {} are not necessary for any arm of this statement"
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Replace use of fprintf(stderr, ...) for error output with err(),
errx(), warn(), or warnx() in chcp, dumpseg, lscp, lssu, mkcp, rmcp,
nilfs-tune, and cleanerd.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Use EXIT_SUCCESS and EXIT_FAILURE macros for exit status to clarify
the meaning of hard coded constants (0 or 1).
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix error handling of lssu_get_protcno() and lssu_print_suinfo() so
that lssu can exit cleanly calling nilfs_close() in error cases.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix error handling of nilfs_get_cpstat() so that rmcp can exit cleanly
calling nilfs_close() in error cases.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Shorten or split long lines to avoid the checkpatch warning "WARNING:
line over 80 characters".
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
As FSF address changed in the past, and can change in the future,
remove the extra paragraph which metions FSF address in comment
headers, and avoid errors of checkpatch.pl.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
If the minimum checkpoint number of valid checkpoints is large to some
extent, "lscp -r" command takes very long time:
$ lscp -r
CNO DATE TIME MODE FLG BLKCNT ICNT
6541269 2015-02-11 18:38:30 cp - 435 2
6541268 2015-02-11 18:38:25 cp - 484 51
<the command looks to enter a busy loop>
This is because it tries to find younger checkpoints tracking back the
checkpoint list in a constant step size.
This fixes the issue by lengthening or shortening the step size
depending on whether the backward search found a younger checkpoint or
not.
This patch also inserts a dummy nilfs_get_cpinfo() call before
starting the backward search to make successive nilfs_get_cpinfo()
calls much faster.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Apply the same change as the commit
d04aea7db2281d2f22d1c943dc5791931db8c474 "lscp: always show snapshots,
even if marked minor" for reverse mode.
Cc: Dan McGee <dan@archlinux.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
When the average user types `lscp` and doesn't see the snapshot they
just tried to make, it can be very confusing. Add an additional check
to ensure snapshots are never omitted from lscp output.
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The error message on failure of nilfs_open() function has two issues
in commands lscp, lssu, mkcp, chcp, rmcp, and dumpseg:
1) When device name is omitted, a null pointer is passed to a string
type field of the error message and a broken message is printed as
below:
lssu: (null): cannot open NILFS
2) Description of errno is not shown in the error message.
This fixes these issues.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix the following gcc warning on some platforms:
lssu.c: In function 'lssu_print_header':
lssu.c:127:2: warning: format not a string literal and no format arguments [-Wformat-security]
printf(lssu_format[disp_mode].header);
^
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix the following checkpatch errors:
ERROR: do not initialise statics to 0 or NULL
#92: FILE: lscp.c:92:
+static int show_all = 0;
ERROR: do not initialise statics to 0 or NULL
#82: FILE: rmcp.c:82:
+static int force = 0;
ERROR: do not initialise statics to 0 or NULL
#83: FILE: rmcp.c:83:
+static int interactive = 0;
ERROR: do not initialise statics to 0 or NULL
#108: FILE: mkfs/mkfs.c:108:
+static int quiet = 0;
ERROR: do not initialise statics to 0 or NULL
#109: FILE: mkfs/mkfs.c:109:
+static int cflag = 0;
ERROR: do not initialise statics to 0 or NULL
#110: FILE: mkfs/mkfs.c:110:
+static int nflag = 0;
ERROR: do not initialise statics to 0 or NULL
#111: FILE: mkfs/mkfs.c:111:
+static int verbose = 0;
ERROR: do not initialise statics to 0 or NULL
#113: FILE: mkfs/mkfs.c:113:
+static int force_overwrite = 0;
ERROR: do not initialise statics to 0 or NULL
#118: FILE: mkfs/mkfs.c:118:
+static time_t creation_time = 0;
ERROR: do not initialise statics to 0 or NULL
#236: FILE: mkfs/mkfs.c:236:
+static void **disk_buffer = NULL;
ERROR: do not initialise statics to 0 or NULL
#54: FILE: mount/fstab.c:54:
+static int have_mtab_info = 0;
ERROR: do not initialise statics to 0 or NULL
#55: FILE: mount/fstab.c:55:
+static int var_mtab_does_not_exist = 0;
ERROR: do not initialise statics to 0 or NULL
#56: FILE: mount/fstab.c:56:
+static int var_mtab_is_a_symlink = 0;
ERROR: do not initialise statics to 0 or NULL
#108: FILE: mount/fstab.c:108:
+static int got_mtab = 0;
ERROR: do not initialise statics to 0 or NULL
#109: FILE: mount/fstab.c:109:
+static int got_fstab = 0;
ERROR: do not initialise statics to 0 or NULL
#327: FILE: mount/fstab.c:327:
+static int we_created_lockfile = 0;
ERROR: do not initialise statics to 0 or NULL
#331: FILE: mount/fstab.c:331:
+static int signals_have_been_setup = 0;
ERROR: do not initialise globals to 0 or NULL
#97: FILE: mount/mount.nilfs2.c:97:
+int verbose = 0;
ERROR: do not initialise globals to 0 or NULL
#98: FILE: mount/mount.nilfs2.c:98:
+int mount_quiet = 0;
ERROR: do not initialise globals to 0 or NULL
#99: FILE: mount/mount.nilfs2.c:99:
+int readonly = 0;
ERROR: do not initialise globals to 0 or NULL
#100: FILE: mount/mount.nilfs2.c💯
+int readwrite = 0;
ERROR: do not initialise statics to 0 or NULL
#101: FILE: mount/mount.nilfs2.c:101:
+static int nomtab = 0;
ERROR: do not initialise statics to 0 or NULL
#102: FILE: mount/mount.nilfs2.c:102:
+static int devro = 0;
ERROR: do not initialise statics to 0 or NULL
#103: FILE: mount/mount.nilfs2.c:103:
+static int fake = 0;
ERROR: do not initialise globals to 0 or NULL
#90: FILE: mount/mount_libmount.c:90:
+int mount_quiet = 0; /* for sundries.c */
ERROR: do not initialise statics to 0 or NULL
#91: FILE: mount/mount_libmount.c:91:
+static int verbose = 0;
ERROR: do not initialise statics to 0 or NULL
#92: FILE: mount/mount_libmount.c:92:
+static int devro = 0;
ERROR: do not initialise statics to 0 or NULL
#94: FILE: mount/mount_libmount.c:94:
+static char *mount_fstype = NULL;
ERROR: do not initialise globals to 0 or NULL
#98: FILE: mount/umount.nilfs2.c:98:
+int verbose = 0;
ERROR: do not initialise globals to 0 or NULL
#99: FILE: mount/umount.nilfs2.c:99:
+int mount_quiet = 0;
ERROR: do not initialise globals to 0 or NULL
#100: FILE: mount/umount.nilfs2.c💯
+int readonly = 0;
ERROR: do not initialise globals to 0 or NULL
#101: FILE: mount/umount.nilfs2.c:101:
+int readwrite = 0;
ERROR: do not initialise statics to 0 or NULL
#102: FILE: mount/umount.nilfs2.c:102:
+static int nomtab = 0;
ERROR: do not initialise globals to 0 or NULL
#82: FILE: mount/umount_libmount.c:82:
+int mount_quiet = 0; /* for sundries.c */
ERROR: do not initialise statics to 0 or NULL
#83: FILE: mount/umount_libmount.c:83:
+static int verbose = 0;
ERROR: do not initialise statics to 0 or NULL
#84: FILE: mount/umount_libmount.c:84:
+static int force = 0;
ERROR: do not initialise statics to 0 or NULL
#85: FILE: mount/umount_libmount.c:85:
+static int suid = 0; /* reserved for non-root user mount/umount
ERROR: do not initialise statics to 0 or NULL
#125: FILE: nilfs-clean/nilfs-clean.c:125:
+static int show_version_only = 0;
ERROR: do not initialise statics to 0 or NULL
#126: FILE: nilfs-clean/nilfs-clean.c:126:
+static int verbose = 0;
ERROR: do not initialise statics to 0 or NULL
#128: FILE: nilfs-clean/nilfs-clean.c:128:
+static const char *conffile = NULL;
ERROR: do not initialise statics to 0 or NULL
#105: FILE: nilfs-resize/nilfs-resize.c:105:
+static int show_version_only = 0;
ERROR: do not initialise statics to 0 or NULL
#106: FILE: nilfs-resize/nilfs-resize.c:106:
+static int verbose = 0;
ERROR: do not initialise statics to 0 or NULL
#107: FILE: nilfs-resize/nilfs-resize.c:107:
+static int assume_yes = 0;
ERROR: do not initialise statics to 0 or NULL
#143: FILE: nilfs-resize/nilfs-resize.c:143:
+static int pm_in_progress = 0; /* 0: off, 1: on, -1: interrupted */
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix the following checkpatch warnings:
WARNING: labels should not be indented
#218: FILE: lssu.c:218:
+ skip_scan:
WARNING: labels should not be indented
#1565: FILE: cleanerd/cleanerd.c:1565:
+ sleep:
WARNING: labels should not be indented
#58: FILE: mount/mount_mntent.c:58:
+ next:
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix the following checkpatch warnings:
WARNING: storage class should be at the beginning of the declaration
#54: FILE: dumpseg.c:54:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#57: FILE: lscp.c:57:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#61: FILE: lssu.c:61:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#100: FILE: lssu.c💯
+const static struct lssu_format lssu_format[] = {
WARNING: storage class should be at the beginning of the declaration
#53: FILE: mkcp.c:53:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#57: FILE: rmcp.c:57:
+const static struct option long_options[] = {
WARNING: storage class should be at the beginning of the declaration
#85: FILE: nilfs-tune/nilfs-tune.c:85:
+const static __u64 ok_features[NILFS_MAX_FEATURE_TYPES] = {
WARNING: storage class should be at the beginning of the declaration
#94: FILE: nilfs-tune/nilfs-tune.c:94:
+const static __u64 clear_ok_features[NILFS_MAX_FEATURE_TYPES] = {
WARNING: storage class should be at the beginning of the declaration
#96: FILE: cleanerd/cleanerd.c:96:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#1060: FILE: mkfs/mkfs.c:1060:
+const static __u64 ok_features[NILFS_MAX_FEATURE_TYPES] = {
WARNING: storage class should be at the beginning of the declaration
#70: FILE: nilfs-clean/nilfs-clean.c:70:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#72: FILE: nilfs-resize/nilfs-resize.c:72:
+const static struct option long_option[] = {
WARNING: storage class should be at the beginning of the declaration
#144: FILE: nilfs-resize/nilfs-resize.c:144:
+const static char *pm_label;
WARNING: storage class should be at the beginning of the declaration
#707: FILE: nilfs-resize/nilfs-resize.c:707:
+ const static struct timespec retry_interval = { 0, 500000000 };
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Simplify some calculations in lssu, lscp, lib/gc.c, lib/nilfs.c,
lib/cnoconv.c, and cleanerd with min_t() and max_t().
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Display a "p" flag in STAT field of the output lines of protected
segments when -l (--latest-usage) option is specfied. This flag
clarifies which segments are protected by garbage collection at that
moment.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fix a bug of nilfs_get_latest_usage() function which blocks the
protection period specified with -p option from being passed to
nilfs_assess_segment() function and results in incorrect output of
live block counts.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This adds new options "-l" and "-p" to lssu command.
"-l" option prints count and ratio of live blocks for in-use segments,
and "-p" option allows users to specify a protection period which is
used to judge whether blocks are live or not.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This renames checkpoint number library "lib/cno.c" to "lib/parser.c",
and moves a parser routine of a protection period option included in
nilfs-clean.c into parser.c to make it available from other programs.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
For each checkpoint of NILFS2, total block count (BLKCNT) is more
meaningful information than appended block count (NBLKINC). This
changes the default display information of lscp command on block count
to BLKCNT from NBLKINC, and updates relevant man pages. NBLKINC can
be still displayed when we specified '-g' option.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The following files are missing in the archive files generated by
"make dist-*":
- .gitignore files
- autogen.sh script
- checkpatch.pl script
This fixes the issue.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This fixes the following checkpatch errors:
ERROR: do not use assignment in if condition
#147: FILE: bin/rmcp.c:147:
+ if ((progname = strrchr(argv[0], '/')) == NULL)
ERROR: do not use assignment in if condition
#85: FILE: bin/mkcp.c:85:
+ if ((progname = strrchr(argv[0], '/')) == NULL)
ERROR: do not use assignment in if condition
#183: FILE: bin/dumpseg.c:183:
+ if ((progname = strrchr(argv[0], '/')) == NULL)
ERROR: do not use assignment in if condition
#239: FILE: bin/dumpseg.c:239:
+ if ((segsize = nilfs_get_segment(nilfs, segnum, &seg)) < 0) {
ERROR: do not use assignment in if condition
#90: FILE: bin/chcp.c:90:
+ if ((progname = strrchr(argv[0], '/')) == NULL)
ERROR: do not use assignment in if condition
#306: FILE: lib/gc.c:306:
+ if ((n = nilfs_get_vinfo(nilfs, vinfo, j)) < 0)
ERROR: do not use assignment in if condition
#345: FILE: lib/gc.c:345:
+ if ((n = nilfs_get_cpinfo(
ERROR: do not use assignment in if condition
#465: FILE: lib/gc.c:465:
+ if ((n = nilfs_get_snapshot(nilfs, &ss)) < 0)
ERROR: do not use assignment in if condition
#559: FILE: lib/gc.c:559:
+ if ((n = nilfs_get_bdescs(nilfs, bdescs + i, count)) < 0)
ERROR: do not use assignment in if condition
#127: FILE: lib/nilfs.c:127:
+ if ((q = strchr(p, MNTOPT_SEP)) != NULL) {
ERROR: do not use assignment in if condition
#248: FILE: lib/nilfs.c:248:
+ if ((pagesize = sysconf(_SC_PAGESIZE)) < 0)
ERROR: do not use assignment in if condition
#668: FILE: lib/nilfs.c:668:
+ if (((ret = ioctl(nilfs->n_iocfd, NILFS_IOCTL_SYNC, cnop)) < 0) &&
ERROR: do not use assignment in if condition
#742: FILE: lib/nilfs.c:742:
+ if ((segment = mmap(0, segsize, PROT_READ, MAP_SHARED,
ERROR: do not use assignment in if condition
#747: FILE: lib/nilfs.c:747:
+ if ((segment = malloc(segsize)) == NULL)
ERROR: do not use assignment in if condition
#42: FILE: lib/vector.c:42:
+ if ((vector = malloc(sizeof(struct nilfs_vector))) == NULL)
ERROR: do not use assignment in if condition
#45: FILE: lib/vector.c:45:
+ if ((vector->v_data = malloc(elemsize * NILFS_VECTOR_INIT_MAXELEMS)) == NULL) {
ERROR: do not use assignment in if condition
#91: FILE: lib/vector.c:91:
+ if ((data = realloc(vector->v_data,
ERROR: do not use assignment in if condition
#622: FILE: sbin/mkfs/mkfs.c:622:
+ if ((fd = open(device, O_RDWR)) < 0)
ERROR: do not use assignment in if condition
#1059: FILE: sbin/mkfs/mkfs.c:1059:
+ if ((cbufp = rindex(cbuf, '\n')) != NULL)
ERROR: do not use assignment in if condition
#1152: FILE: sbin/nilfs-resize/nilfs-resize.c:1152:
+ if ((progname = strrchr(argv[0], '/')) != NULL)
ERROR: do not use assignment in if condition
#685: FILE: sbin/cleanerd/cldconfig.c:685:
+ if ((fp = fopen(conffile, "r")) == NULL)
ERROR: do not use assignment in if condition
#695: FILE: sbin/cleanerd/cldconfig.c:695:
+ if ((ntoks = tokenize(line, tokens, NTOKENS_MAX)) == 0)
ERROR: do not use assignment in if condition
#697: FILE: sbin/cleanerd/cldconfig.c:697:
+ if ((ret = nilfs_cldconfig_handle_keyword(
ERROR: do not use assignment in if condition
#584: FILE: sbin/cleanerd/cleanerd.c:584:
+ if ((smv = nilfs_vector_create(sizeof(struct nilfs_segimp))) == NULL)
ERROR: do not use assignment in if condition
#606: FILE: sbin/cleanerd/cleanerd.c:606:
+ if ((n = nilfs_get_suinfo(nilfs, segnum, si, count)) < 0) {
ERROR: do not use assignment in if condition
#611: FILE: sbin/cleanerd/cleanerd.c:611:
+ if (nilfs_suinfo_reclaimable(&si[i]) &&
ERROR: do not use assignment in if condition
#660: FILE: sbin/cleanerd/cleanerd.c:660:
+ if ((pid = fork()) < 0)
ERROR: do not use assignment in if condition
#310: FILE: sbin/mount/fstab.c:310:
+ if ((opts = mc->m.mnt_opts) != NULL
ERROR: do not use assignment in if condition
#278: FILE: sbin/mount/umount.nilfs2.c:278:
+ if ((fd = open (device, O_RDONLY)) < 0) {
ERROR: do not use assignment in if condition
#391: FILE: sbin/mount/umount.nilfs2.c:391:
+ if (!read_only_mount_point(mc) &&
ERROR: do not use assignment in if condition
#471: FILE: sbin/mount/umount.nilfs2.c:471:
+ if ((mc = getmntoptfile (spec)) != NULL)
ERROR: do not use assignment in if condition
#494: FILE: sbin/nilfs-clean/nilfs-clean.c:494:
+ if ((progname = strrchr(argv[0], '/')) != NULL)
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This fixes the following coding style issues:
ERROR: space required after that ',' (ctx:VxV)
#51: FILE: bin/lssu.c:51:
+ {"index",required_argument, NULL, 'i'},
^
ERROR: space required after that ',' (ctx:VxV)
#52: FILE: bin/lssu.c:52:
+ {"lines",required_argument, NULL, 'n'},
^
ERROR: space required after that ',' (ctx:VxV)
#88: FILE: sbin/mkfs/mkfs.c:88:
+#define ROUNDUP_DIV(n,m) (((n) - 1) / (m) + 1)
^
ERROR: space required after that ',' (ctx:VxV)
#89: FILE: sbin/mkfs/mkfs.c:89:
+#define max_t(type,x,y) \
^
ERROR: space required after that ',' (ctx:VxV)
#89: FILE: sbin/mkfs/mkfs.c:89:
+#define max_t(type,x,y) \
^
ERROR: space required after that ',' (ctx:VxV)
#307: FILE: sbin/mkfs/mkfs.c:307:
+#define BLKDISCARD _IO(0x12,119)
^
ERROR: space required after that ',' (ctx:VxV)
#311: FILE: sbin/mkfs/mkfs.c:311:
+#define BLKDISCARDZEROES _IO(0x12,124)
^
ERROR: space required after that ',' (ctx:VxV)
#19: FILE: sbin/mkfs/bitops.c:19:
+int ext2fs_set_bit(int nr,void * addr)
^
ERROR: space required after that ',' (ctx:VxV)
#55: FILE: sbin/mkfs/mkfs.h:55:
+extern int ext2fs_set_bit(int nr,void * addr);
^
...
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
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>