ZFS_ENTER(zsb);
ZFS_VERIFY_ZP(zp);
- /* Decrement the synchronous opens in the znode */
+ /*
+ * Zero the synchronous opens in the znode. Under Linux the
+ * zfs_close() hook is not symmetric with zfs_open(), it is
+ * only called once when the last reference is dropped.
+ */
if (flag & O_SYNC)
zp->z_sync_cnt = 0;
}
#endif /* _KERNEL */
-offset_t zfs_read_chunk_size = 1024 * 1024; /* Tunable */
+unsigned long zfs_read_chunk_size = 1024 * 1024; /* Tunable */
/*
* Read bytes from specified file into supplied buffer.
zfs_acl_t *aclp;
boolean_t skipaclchk = (flags & ATTR_NOACLCHECK) ? B_TRUE : B_FALSE;
boolean_t fuid_dirtied = B_FALSE;
- sa_bulk_attr_t bulk[7], xattr_bulk[7];
+ sa_bulk_attr_t *bulk, *xattr_bulk;
int count = 0, xattr_count = 0;
if (mask == 0)
tmpxvattr = kmem_alloc(sizeof(xvattr_t), KM_SLEEP);
xva_init(tmpxvattr);
+ bulk = kmem_alloc(sizeof(sa_bulk_attr_t) * 7, KM_SLEEP);
+ xattr_bulk = kmem_alloc(sizeof(sa_bulk_attr_t) * 7, KM_SLEEP);
+
/*
* Immutable files can only alter immutable bit and atime
*/
zil_commit(zilog, 0);
out3:
+ kmem_free(xattr_bulk, sizeof(sa_bulk_attr_t) * 7);
+ kmem_free(bulk, sizeof(sa_bulk_attr_t) * 7);
kmem_free(tmpxvattr, sizeof(xvattr_t));
ZFS_EXIT(zsb);
return (err);
return (0);
}
#endif /* HAVE_UIO_ZEROCOPY */
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+module_param(zfs_read_chunk_size, long, 0644);
+MODULE_PARM_DESC(zfs_read_chunk_size, "Bytes to read per chunk");
+#endif