cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 16/17] gfs2: Add support for statx inode flags
Date: Mon, 13 Nov 2017 08:36:01 -0600	[thread overview]
Message-ID: <20171113143602.1319-17-rpeterso@redhat.com> (raw)
In-Reply-To: <20171113143602.1319-1-rpeterso@redhat.com>

From: Andreas Gruenbacher <agruenba@redhat.com>

Add support for the STATX_ATTR_ flags in statx.  (Compression,
encryption, and the nodump flag are not supported by gfs2.)

Partially fixes xfstest generic/424.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/inode.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 4749a6b8e4dd..4e971b1c7f92 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1987,6 +1987,7 @@ static int gfs2_getattr(const struct path *path, struct kstat *stat,
 	struct inode *inode = d_inode(path->dentry);
 	struct gfs2_inode *ip = GFS2_I(inode);
 	struct gfs2_holder gh;
+	u32 gfsflags;
 	int error;
 
 	gfs2_holder_mark_uninitialized(&gh);
@@ -1996,7 +1997,20 @@ static int gfs2_getattr(const struct path *path, struct kstat *stat,
 			return error;
 	}
 
+	gfsflags = ip->i_diskflags;
+	if (gfsflags & GFS2_DIF_APPENDONLY)
+		stat->attributes |= STATX_ATTR_APPEND;
+	if (gfsflags & GFS2_DIF_IMMUTABLE)
+		stat->attributes |= STATX_ATTR_IMMUTABLE;
+
+	stat->attributes_mask |= (STATX_ATTR_APPEND |
+				  STATX_ATTR_COMPRESSED |
+				  STATX_ATTR_ENCRYPTED |
+				  STATX_ATTR_IMMUTABLE |
+				  STATX_ATTR_NODUMP);
+
 	generic_fillattr(inode, stat);
+
 	if (gfs2_holder_initialized(&gh))
 		gfs2_glock_dq_uninit(&gh);
 
-- 
2.13.6



  parent reply	other threads:[~2017-11-13 14:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 14:35 [Cluster-devel] [PATCH 00/17] GFS2: Pre-pull patch posting (merge window) Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 01/17] gfs2: Clarify gfs2_block_map Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 02/17] gfs2: Update ctime in setflags ioctl Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 03/17] gfs2: Support negative atimes Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 04/17] gfs2: Always update inode ctime in set_acl Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 05/17] iomap: Switch from blkno to disk offset Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 06/17] iomap: Add IOMAP_F_DATA_INLINE flag Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 07/17] GFS2: Make height info part of metapath Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 08/17] GFS2: Implement iomap for block_map Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 09/17] GFS2: Switch fiemap implementation to use iomap Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 10/17] gfs2: Implement SEEK_HOLE / SEEK_DATA via iomap Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 11/17] GFS2: flush the log and all pages for jdata as we do for WB_SYNC_ALL Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 12/17] GFS2: Take inode off order_write list when setting jdata flag Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 13/17] gfs2: Fix xattr fsync Bob Peterson
2017-11-13 14:35 ` [Cluster-devel] [PATCH 14/17] gfs2: Fix a harmless typo Bob Peterson
2017-11-13 14:36 ` [Cluster-devel] [PATCH 15/17] gfs2: Fix and clean up {GET, SET}FLAGS ioctl Bob Peterson
2017-11-13 14:36 ` Bob Peterson [this message]
2017-11-13 14:36 ` [Cluster-devel] [PATCH 17/17] gfs2: Allow gfs2_xattr_set to be called with the glock held Bob Peterson

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=20171113143602.1319-17-rpeterso@redhat.com \
    --to=rpeterso@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).