Skip to content

Commit

Permalink
Merge pull request #7 from linux-ha-japan/repo-1.1.14
Browse files Browse the repository at this point in the history
Repo 1.1.14
  • Loading branch information
Yusuke Iida committed Mar 30, 2016
2 parents f96ab28 + 30e42ce commit 0aad5e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.53])
AC_INIT([pm_diskd], [2.1], [[email protected]])
AC_INIT([pm_diskd], [2.2], [[email protected]])
AM_INIT_AUTOMAKE

# Checks for programs.
Expand Down
13 changes: 3 additions & 10 deletions tools/diskd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
* Ver.2.0 for Pacemaker 1.1.x
*/

#define _GNU_SOURCE /* when using O_DIRECT flag, define it before including fnctl.h */

#include <sys/param.h>

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>

#include <stdlib.h>
Expand Down Expand Up @@ -60,7 +61,6 @@
#define normal -1
#define NONE 2

#define BLKFLSBUF _IO(0x12,97) /* flush buffer. refer linux/hs.h */
#define WRITE_DATA 64

#define WRITE_DIR "/tmp"
Expand Down Expand Up @@ -513,19 +513,12 @@ static int diskcheck(gpointer data)
sleep(retry_interval);
}

fd = open((const char *)device, O_RDONLY | O_NONBLOCK, 0);
fd = open((const char *)device, O_RDONLY | O_NONBLOCK | O_DIRECT, 0);
if (fd == -1) {
crm_err("Could not open device %s", device);
continue;
}

err = ioctl(fd, BLKFLSBUF, 0);
if (err != 0) {
crm_err("ioctl error, Could not flush buffer");
close(fd);
continue;
}

while( 1 ) {
err = read(fd, buf, pagesize);
if (err == pagesize) {
Expand Down

0 comments on commit 0aad5e6

Please sign in to comment.