Remove local ioctl definitions and use <linux/fs.h>
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Fri, 13 Jun 2014 11:39:48 +0000 (14:39 +0300)
committerDmitry Kasatkin <d.kasatkin@samsung.com>
Wed, 25 Jun 2014 15:54:55 +0000 (18:54 +0300)
Use standard flags, supported by ext2/3/4

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
src/evmctl.c
src/imaevm.h

index 4601eab..1e37119 100644 (file)
@@ -529,7 +529,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
                        log_err("Unable to open %s\n", file);
                        return -1;
                }
-               if (ioctl(fd, EXT34_IOC_GETVERSION, &generation)) {
+               if (ioctl(fd, FS_IOC_GETVERSION, &generation)) {
                        log_err("ioctl() failed\n");
                        return -1;
                }
@@ -1082,7 +1082,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
                        log_err("Unable to open %s\n", file);
                        goto out;
                }
-               if (ioctl(fd, EXT34_IOC_GETVERSION, &generation)) {
+               if (ioctl(fd, FS_IOC_GETVERSION, &generation)) {
                        log_err("ioctl() failed\n");
                        goto out;
                }
index 7e784ec..02fe850 100644 (file)
@@ -41,6 +41,7 @@
 #ifndef _LIBIMAEVM_H
 #define _LIBIMAEVM_H
 
+#include <linux/fs.h>
 #include <stdint.h>
 #include <syslog.h>
 #include <stdbool.h>
 #define        DATA_SIZE       4096
 #define SHA1_HASH_LEN   20
 
-#define        EXT2_IOC_GETVERSION     _IOR('v', 1, long)
-#define        EXT34_IOC_GETVERSION    _IOR('f', 3, long)
-
-#define        FS_IOC_GETFLAGS         _IOR('f', 1, long)
-#define        FS_IOC_SETFLAGS         _IOW('f', 2, long)
-#define FS_IOC32_GETFLAGS      _IOR('f', 1, int)
-#define FS_IOC32_SETFLAGS      _IOW('f', 2, int)
-
 #define __packed __attribute__((packed))
 
 enum evm_ima_xattr_type {