public inbox for [email protected]
 help / color / mirror / Atom feed
From: Stefan Roesch <[email protected]>
To: <[email protected]>, <[email protected]>
Cc: <[email protected]>
Subject: [PATCH v2 3/4] liburing: Add helper functions for fgetxattr and getxattr
Date: Wed, 23 Mar 2022 08:44:56 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Summary:

This adds the helper functions for:
- fgetxattr
- getxattr

Signed-off-by: Stefan Roesch <[email protected]>
---
 src/include/liburing.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/include/liburing.h b/src/include/liburing.h
index 0b5dfab..105f5dc 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -729,6 +729,17 @@ static inline void io_uring_prep_msg_ring(struct io_uring_sqe *sqe, int fd,
 	sqe->rw_flags = flags;
 }
 
+static inline void io_uring_prep_getxattr(struct io_uring_sqe *sqe,
+					  const char *name,
+					  const char *value,
+					  const char *path,
+					  size_t len)
+{
+	io_uring_prep_rw(IORING_OP_GETXATTR, sqe, 0, name, len, (__u64) value);
+	sqe->addr3 = (__u64) path;
+	sqe->xattr_flags = 0;
+}
+
 static inline void io_uring_prep_setxattr(struct io_uring_sqe *sqe,
 					  const char *name,
 					  const char *value,
@@ -741,6 +752,16 @@ static inline void io_uring_prep_setxattr(struct io_uring_sqe *sqe,
 	sqe->xattr_flags = flags;
 }
 
+static inline void io_uring_prep_fgetxattr(struct io_uring_sqe *sqe,
+		                           int         fd,
+					   const char *name,
+					   const char *value,
+					   size_t      len)
+{
+	io_uring_prep_rw(IORING_OP_FGETXATTR, sqe, fd, name, len, (__u64) value);
+	sqe->xattr_flags = 0;
+}
+
 static inline void io_uring_prep_fsetxattr(struct io_uring_sqe *sqe,
 					   int         fd,
 					   const char *name,
-- 
2.30.2


  parent reply	other threads:[~2022-03-23 15:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 15:44 [PATCH v2 0/4] liburing: support xattr functions Stefan Roesch
2022-03-23 15:44 ` [PATCH v2 1/4] liburing: Update io_uring in liburing Stefan Roesch
2022-03-23 15:44 ` [PATCH v2 2/4] liburing: add helper functions for setxattr and fsetxattr Stefan Roesch
2022-03-23 15:44 ` Stefan Roesch [this message]
2022-03-23 15:44 ` [PATCH v2 4/4] liburing: Add new test program to verify xattr support Stefan Roesch
2022-03-30 20:47 ` [PATCH v2 0/4] liburing: support xattr functions Jens Axboe
2022-03-31 12:06 ` Jens Axboe

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox