From 702a8eec8cb84345336274f50e1b73a451b6295f 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 ffddaba..df39866 100644 --- a/src/bees.cc +++ b/src/bees.cc @@ -432,12 +432,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;