From 54e724c0f7d24f11bd03191a567940bfefe8ab40 Mon Sep 17 00:00:00 2001 From: Jan Tulak Date: Wed, 14 Oct 2015 10:57:57 +1100 Subject: [PATCH] libxfs: prefix XATTR_LIST_MAX with XFS_ As we depends on XATTR_ value that is available only on some platforms, prefix it with XFS_ and allow for an alternative value in future. Signed-off-by: Jan Tulak Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libhandle/handle.c | 4 ++-- libhandle/jdm.c | 4 ++-- libxfs/xfs_fs.h | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libhandle/handle.c b/libhandle/handle.c index b1c0c1049..7207186b1 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -397,8 +397,8 @@ attr_list_by_handle( alhreq.buffer = buf; alhreq.buflen = bufsize; /* prevent needless EINVAL from the kernel */ - if (alhreq.buflen > XATTR_LIST_MAX) - alhreq.buflen = XATTR_LIST_MAX; + if (alhreq.buflen > XFS_XATTR_LIST_MAX) + alhreq.buflen = XFS_XATTR_LIST_MAX; error = xfsctl(path, fd, XFS_IOC_ATTRLIST_BY_HANDLE, &alhreq); diff --git a/libhandle/jdm.c b/libhandle/jdm.c index d8044237b..e52f5d838 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -168,8 +168,8 @@ jdm_attr_list( jdm_fshandle_t *fshp, int rval; /* prevent needless EINVAL from the kernel */ - if (bufsz > XATTR_LIST_MAX) - bufsz = XATTR_LIST_MAX; + if (bufsz > XFS_XATTR_LIST_MAX) + bufsz = XFS_XATTR_LIST_MAX; jdm_fill_filehandle( &filehandle, fshandlep, statp ); rval = attr_list_by_handle (( void * )&filehandle, diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index 0c922ade2..c14903ed9 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -489,6 +489,15 @@ typedef struct xfs_swapext #define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */ #define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */ +/* + * ioctl limits + */ +#ifdef XATTR_LIST_MAX +# define XFS_XATTR_LIST_MAX XATTR_LIST_MAX +#else +# define XFS_XATTR_LIST_MAX 65536 +#endif + /* * ioctl commands that are used by Linux filesystems */ -- 2.47.2