/* Returns a negative error number on failure, or the number of bytes used / required on success.  */
int ext4_xattr_get(struct inode *inode, int name_index, const char *name, void *buffer, size_t buffer_size)
/* Returns a negative error number on failure, or the number of bytes used / required on success.  */
int ext4_xattr_get(struct inode *inode, int name_index, const char *name, void *buffer, size_t buffer_size)
{
	int error;
	down_read(&EXT4_I(inode)->xattr_sem);
	error = ext4_xattr_ibody_get(inode, name_index, name, buffer,
				     buffer_size);
	if (error == -ENODATA)
		error = ext4_xattr_block_get(inode, name_index, name, buffer,
					     buffer_size);
	up_read(&EXT4_I(inode)->xattr_sem);
	return error;
}