All of lore.kernel.org
 help / color / mirror / Atom feed
From: piaojun <piaojun@huawei.com>
To: <virtio-fs@redhat.com>, <qemu-devel@nongnu.org>
Cc: piaojun@huawei.com
Subject: [Qemu-devel] [PATCH] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined
Date: Tue, 30 Jul 2019 08:27:48 +0800	[thread overview]
Message-ID: <5D3F8F04.3030404@huawei.com> (raw)

Use F_GETLK for fcntl when F_OFD_GETLK not defined.

Signed-off-by: Jun Piao <piaojun@huawei.com>
---
 contrib/virtiofsd/passthrough_ll.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
index 9ae1381..757785b 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -1619,7 +1619,11 @@ static void lo_getlk(fuse_req_t req, fuse_ino_t ino,
 		return;
 	}

+#ifdef F_OFD_GETLK
 	ret = fcntl(plock->fd, F_OFD_GETLK, lock);
+#else
+	ret = fcntl(plock->fd, F_GETLK, lock);
+#endif
 	if (ret == -1)
 		saverr = errno;
 	pthread_mutex_unlock(&inode->plock_mutex);
@@ -1668,7 +1672,12 @@ static void lo_setlk(fuse_req_t req, fuse_ino_t ino,

 	/* TODO: Is it alright to modify flock? */
 	lock->l_pid = 0;
+
+#ifdef F_OFD_GETLK
 	ret = fcntl(plock->fd, F_OFD_SETLK, lock);
+#else
+	ret = fcntl(plock->fd, F_SETLK, lock);
+#endif
 	if (ret == -1) {
 		saverr = errno;
 	}
-- 


             reply	other threads:[~2019-07-30  0:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30  0:27 piaojun [this message]
2019-07-30 12:22 ` [Virtio-fs] [Qemu-devel] [PATCH] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined Liam Merwick
2019-07-30 12:22   ` Liam Merwick
2019-07-30 13:08   ` piaojun
2019-07-30 13:28 ` [Virtio-fs] " Eric Blake
2019-07-30 13:28   ` Eric Blake
2019-07-30 14:00   ` piaojun
2019-08-01 14:20   ` [Virtio-fs] " Dr. David Alan Gilbert
2019-08-01 14:20     ` [Qemu-devel] [Virtio-fs] " Dr. David Alan Gilbert
2019-08-01 14:26     ` [Virtio-fs] [Qemu-devel] " Dr. David Alan Gilbert
2019-08-01 14:26       ` [Qemu-devel] [Virtio-fs] " Dr. David Alan Gilbert
2019-08-02  8:16       ` [Virtio-fs] [Qemu-devel] " piaojun
2019-08-02  8:16         ` [Qemu-devel] [Virtio-fs] " piaojun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D3F8F04.3030404@huawei.com \
    --to=piaojun@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.