/* Calculate the number of bytes that would be required to store the new attribute (whether local or remote only calculate bytes in this block). This routine decides as a side effect whether the attribute will be a "local" or a "remote" attribute.  */
int xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local)
/* Calculate the number of bytes that would be required to store the new attribute (whether local or remote only calculate bytes in this block). This routine decides as a side effect whether the attribute will be a "local" or a "remote" attribute.  */
int xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local)
{
	int size;
	size = xfs_attr_leaf_entsize_local(namelen, valuelen);
	if (size < xfs_attr_leaf_entsize_local_max(blocksize)) {
		if (local) {
			*local = 1;
		}
	} else {
		size = xfs_attr_leaf_entsize_remote(namelen);
		if (local) {
			*local = 0;
		}
	}
	return(size);
}