From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Xiao Yang <yangx.jy@cn.fujitsu.com>
Cc: guaneryu@gmail.com, fstests@vger.kernel.org
Subject: Re: [PATCH 2/2] src/dmiperf: Stop using attr_setf
Date: Tue, 8 Dec 2020 10:24:23 -0800 [thread overview]
Message-ID: <20201208182423.GI106271@magnolia> (raw)
In-Reply-To: <20201208064005.1187031-2-yangx.jy@cn.fujitsu.com>
On Tue, Dec 08, 2020 at 02:40:05PM +0800, Xiao Yang wrote:
> Avoid the following warning by replacing deprecated
> attr_setf with fsetxattr:
> ---------------------------------------------------
> dmiperf.c:192:2: warning: 'attr_setf' is deprecated: Use fsetxattr instead [-Wdeprecated-declarations]
> ---------------------------------------------------
I frankly wonder if it's time to kill the DMI tests since I've never
seen it and none of the functionality is upstream.
--D
>
> Also remove unneeded <attr/attributes.h> and $(LIBATTR).
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> src/Makefile | 2 +-
> src/dmiperf.c | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/Makefile b/src/Makefile
> index 32940142..c0688520 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -33,7 +33,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
>
> SUBDIRS = log-writes perf
>
> -LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL) -lpthread -lrt
> +LLDLIBS = $(LIBHANDLE) $(LIBACL) -lpthread -lrt
>
> ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
> LINUX_TARGETS += loggen
> diff --git a/src/dmiperf.c b/src/dmiperf.c
> index 4026dcfb..f9415953 100644
> --- a/src/dmiperf.c
> +++ b/src/dmiperf.c
> @@ -17,7 +17,7 @@
> #include <stdlib.h>
> #include <string.h>
> #include <unistd.h>
> -#include <attr/attributes.h>
> +#include <sys/xattr.h>
>
> typedef unsigned int uint_t;
>
> @@ -189,8 +189,8 @@ mkfile(char *name, char *attr)
> perror("open");
> exit(1);
> }
> - if (attr_setf(fd, DMFATTRNAME, attr, DMFATTRLEN, ATTR_ROOT) < 0) {
> - perror("attr_setf");
> + if (fsetxattr(fd, DMFATTRNAME, attr, DMFATTRLEN, 0) < 0) {
> + perror("fsetxattr");
> exit(1);
> }
> while (bytes > 0) {
> --
> 2.23.0
>
>
>
next prev parent reply other threads:[~2020-12-08 18:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 6:40 [PATCH 1/2] src/multi_open_unlink: Stop using attr_set Xiao Yang
2020-12-08 6:40 ` [PATCH 2/2] src/dmiperf: Stop using attr_setf Xiao Yang
2020-12-08 18:24 ` Darrick J. Wong [this message]
2020-12-09 1:12 ` Xiao Yang
2020-12-09 4:22 ` Eryu Guan
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=20201208182423.GI106271@magnolia \
--to=darrick.wong@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--cc=yangx.jy@cn.fujitsu.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.