All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] [PATCH v2] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined
@ 2019-08-02  8:38 ` piaojun
  0 siblings, 0 replies; 10+ messages in thread
From: piaojun @ 2019-08-02  8:38 UTC (permalink / raw)
  To: virtio-fs, qemu-devel; +Cc: eblake

Use F_GETLK for fcntl when F_OFD_GETLK not defined, such as kernel 3.10.

Signed-off-by: Jun Piao <piaojun@huawei.com>
---
v2:
- Use F_OFD_SETLK to replace F_OFD_GETLK in #ifdef.

---
 contrib/virtiofsd/passthrough_ll.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
index a81c01d..c69f2f3 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -1780,7 +1780,11 @@ static void lo_getlk(fuse_req_t req, fuse_ino_t ino,
 		goto out;
 	}

+#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;

@@ -1831,7 +1835,11 @@ 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_SETLK
 	ret = fcntl(plock->fd, F_OFD_SETLK, lock);
+#else
+	ret = fcntl(plock->fd, F_GETLK, lock);
+#endif
 	if (ret == -1) {
 		saverr = errno;
 	}
-- 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-08-06 13:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02  8:38 [Virtio-fs] [PATCH v2] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined piaojun
2019-08-02  8:38 ` [Qemu-devel] " piaojun
2019-08-02 10:53 ` [Virtio-fs] " Dr. David Alan Gilbert
2019-08-02 10:53   ` [Qemu-devel] " Dr. David Alan Gilbert
2019-08-02 11:10   ` [Virtio-fs] " Daniel P. Berrangé
2019-08-02 11:10     ` Daniel P. Berrangé
2019-08-04  8:18     ` [Virtio-fs] " piaojun
2019-08-04  8:18       ` piaojun
2019-08-06 13:27   ` [Virtio-fs] " Vivek Goyal
2019-08-06 13:27     ` [Qemu-devel] " Vivek Goyal

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.