[Cluster-devel] [PATCH 2/2] gfs2: Add support for statx inode flags
Andrew Price
anprice at redhat.com
Mon Oct 9 21:50:12 UTC 2017
On Mon, Oct 09, 2017 at 08:37:54PM +0200, Andreas Gruenbacher wrote:
> 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 at 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 863749e29bf9..7d91e2f7f7d0 100644
> --- a/fs/gfs2/inode.c
> +++ b/fs/gfs2/inode.c
> @@ -1986,6 +1986,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);
> @@ -1995,7 +1996,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 |
^^^^^^^
There's a whitespace issue here. Other than that, and perhaps gfs->gfs2 in the subject of patch 1, both patches look good to me.
Cheers,
Andy
> + 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.5
>
More information about the Cluster-devel
mailing list