aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2017-10-09 11:55:58 -0400
committerAndreas Gruenbacher <agruenba@redhat.com>2017-10-31 09:26:58 -0400
commitb2623c2fe6eb1f757eff5a8fb515fe584caac667 (patch)
treeefb8afc55df8e069dbb6a471c595fed4bd5bd82d
parentb16f7e57b7811d5c60ef1858bd92339be28359bf (diff)
gfs2: Add support for statx inode flags
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>
-rw-r--r--fs/gfs2/inode.c14
1 files changed, 14 insertions, 0 deletions
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,
1987 struct inode *inode = d_inode(path->dentry); 1987 struct inode *inode = d_inode(path->dentry);
1988 struct gfs2_inode *ip = GFS2_I(inode); 1988 struct gfs2_inode *ip = GFS2_I(inode);
1989 struct gfs2_holder gh; 1989 struct gfs2_holder gh;
1990 u32 gfsflags;
1990 int error; 1991 int error;
1991 1992
1992 gfs2_holder_mark_uninitialized(&gh); 1993 gfs2_holder_mark_uninitialized(&gh);
@@ -1996,7 +1997,20 @@ static int gfs2_getattr(const struct path *path, struct kstat *stat,
1996 return error; 1997 return error;
1997 } 1998 }
1998 1999
2000 gfsflags = ip->i_diskflags;
2001 if (gfsflags & GFS2_DIF_APPENDONLY)
2002 stat->attributes |= STATX_ATTR_APPEND;
2003 if (gfsflags & GFS2_DIF_IMMUTABLE)
2004 stat->attributes |= STATX_ATTR_IMMUTABLE;
2005
2006 stat->attributes_mask |= (STATX_ATTR_APPEND |
2007 STATX_ATTR_COMPRESSED |
2008 STATX_ATTR_ENCRYPTED |
2009 STATX_ATTR_IMMUTABLE |
2010 STATX_ATTR_NODUMP);
2011
1999 generic_fillattr(inode, stat); 2012 generic_fillattr(inode, stat);
2013
2000 if (gfs2_holder_initialized(&gh)) 2014 if (gfs2_holder_initialized(&gh))
2001 gfs2_glock_dq_uninit(&gh); 2015 gfs2_glock_dq_uninit(&gh);
2002 2016