Re: [PATCH 25/27] xfs_scrub: progress indicator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/5/18 7:54 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>


> +#define NSEC_PER_SEC	(1000000000)
> +static void *
> +progress_report_thread(void *arg)
> +{
> +	struct timespec		abstime;
> +	int			ret;
> +
> +	pthread_mutex_lock(&pt.lock);
> +	while (1) {
> +		/* Every half second. */
> +		ret = clock_gettime(CLOCK_REALTIME, &abstime);


My manpage says "link with -rt" and to include <time.h>, this got me
going:

diff --git a/scrub/Makefile b/scrub/Makefile
index 3e6f690..0094d9d 100644
--- a/scrub/Makefile
+++ b/scrub/Makefile
@@ -67,7 +67,7 @@ xfs_scrub.c
 
 LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBUNISTRING)
 LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG) $(LIBUNISTRING)
-LLDFLAGS = -static
+LLDFLAGS = -static -lrt
 
 ifeq ($(HAVE_MALLINFO),yes)
 LCFLAGS += -DHAVE_MALLINFO
diff --git a/scrub/progress.c b/scrub/progress.c
index 30b2152..61b9c60 100644
--- a/scrub/progress.c
+++ b/scrub/progress.c
@@ -22,6 +22,7 @@
 #include <dirent.h>
 #include <pthread.h>
 #include <sys/statvfs.h>
+#include <time.h>
 #include "../repair/threads.h"
 #include "path.h"
 #include "disk.h"

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux