From 9ba9a8e9fac4e8dd9020fcffa6c8de7ed2bf5f98 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sat, 16 Sep 2017 14:31:43 -0400 Subject: [PATCH] bees: use ioctl_iflags_get and ioctl_iflags_set instead of opencoded versions Signed-off-by: Zygo Blaxell --- src/bees.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bees.cc b/src/bees.cc index 60ee4b6..e248606 100644 --- a/src/bees.cc +++ b/src/bees.cc @@ -439,12 +439,11 @@ BeesTempFile::create() m_ctx->insert_root_ino(m_fd); // Set compression attribute - int flags = 0; - BEESTRACE("Getting FS_COMPR_FL on m_fd " << name_fd(m_fd) << " flags " << to_hex(flags)); - DIE_IF_MINUS_ONE(ioctl(m_fd, FS_IOC_GETFLAGS, &flags)); + BEESTRACE("Getting FS_COMPR_FL on m_fd " << name_fd(m_fd)); + int flags = ioctl_iflags_get(m_fd); flags |= FS_COMPR_FL; BEESTRACE("Setting FS_COMPR_FL on m_fd " << name_fd(m_fd) << " flags " << to_hex(flags)); - DIE_IF_MINUS_ONE(ioctl(m_fd, FS_IOC_SETFLAGS, &flags)); + ioctl_iflags_set(m_fd, flags); // Always leave first block empty to avoid creating a file with an inline extent m_end_offset = BLOCK_SIZE_CLONE;