From b32d9dea71679eb109542c2cf70b397135d95f78 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Sun, 25 Jan 2015 22:41:59 +0900 Subject: [PATCH 2/3] lib/libhammer: cleanups This patch has some minor cleanups of libhammer. hunk1: Remove parentheses hunk2: Remove parentheses hunk3: Remove forward declaration of obsolete function. find_pfs_mount() was re-implemented as a part of libhammer and commit 4f09feab replaces it with libhammer version. --- lib/libhammer/misc.c | 4 ++-- sbin/hammer/cmd_snapshot.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libhammer/misc.c b/lib/libhammer/misc.c index 9a0d0f2..407a8b2 100644 --- a/lib/libhammer/misc.c +++ b/lib/libhammer/misc.c @@ -64,7 +64,7 @@ libhammer_find_pfs_mount(int pfsid, uuid_t parentuuid, int ismaster) if (mntsize <= 0) return retval; - mntbufsize = (mntsize) * sizeof(struct statfs); + mntbufsize = mntsize * sizeof(struct statfs); mntbuf = _libhammer_malloc(mntbufsize); mntsize = getfsstat(mntbuf, (long)mntbufsize, MNT_NOWAIT); @@ -88,7 +88,7 @@ libhammer_find_pfs_mount(int pfsid, uuid_t parentuuid, int ismaster) continue; } - if ((ioctl(fd, HAMMERIOC_GET_INFO, &hi)) < 0) { + if (ioctl(fd, HAMMERIOC_GET_INFO, &hi) < 0) { close(fd); curmount--; continue; diff --git a/sbin/hammer/cmd_snapshot.c b/sbin/hammer/cmd_snapshot.c index 2ca67a8..2703684 100644 --- a/sbin/hammer/cmd_snapshot.c +++ b/sbin/hammer/cmd_snapshot.c @@ -43,8 +43,6 @@ #include #include -extern char *find_pfs_mount(int pfsid, uuid_t parentuuid, int ismaster); - #define DEFAULT_SNAPSHOT_NAME "snap-%Y%m%d-%H%M" static void snapshot_usage(int exit_code); -- 2.1.2