#include <linux/aio.h>
#include <linux/fs.h>
-#include <linux/fs_struct.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
#include <linux/posix_acl_xattr.h>
#define ll_vfs_unlink(a, b) vfs_unlink(a, b)
#endif
-static inline int ll_vfs_getattr(struct path *path, struct kstat *st)
+static inline int ll_vfs_getattr(struct path *path, struct kstat *st,
+ u32 request_mask, unsigned int flags)
{
int rc;
#ifdef HAVE_INODEOPS_ENHANCED_GETATTR
- rc = vfs_getattr(path, st, STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
+ rc = vfs_getattr(path, st, request_mask, flags);
#else
rc = vfs_getattr(path, st);
#endif
* the page cache interaction. Lets keep xa_is_value() separate
* in old kernels for Xarray support and page cache handling.
*/
-#ifdef HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY
+#ifndef HAVE_XARRAY_SUPPORT
static inline bool ll_xa_is_value(void *entry)
{
return radix_tree_exceptional_entry(entry);
struct iovec *iov_copy;
int count = 0;
- OBD_ALLOC(iov_copy, sizeof(*iov_copy) * iter->nr_segs);
+ OBD_ALLOC_PTR_ARRAY(iov_copy, iter->nr_segs);
if (!iov_copy)
return -ENOMEM;
bytes = __generic_file_aio_write(iocb, iov_copy, count,
&iocb->ki_pos);
- OBD_FREE(iov_copy, sizeof(*iov_copy) * iter->nr_segs);
+ OBD_FREE_PTR_ARRAY(iov_copy, iter->nr_segs);
if (bytes > 0)
iov_iter_advance(iter, bytes);