/* RETURNS: 0 on success, -EEXIST if entry with the given name already exists.  */
int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
/* RETURNS: 0 on success, -EEXIST if entry with the given name already exists.  */
int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
{
	struct sysfs_inode_attrs *ps_iattr;
	if (sysfs_find_dirent(acxt->parent_sd, sd->s_name))
		return -EEXIST;
	sd->s_parent = sysfs_get(acxt->parent_sd);
	sysfs_link_sibling(sd);
	ps_iattr = acxt->parent_sd->s_iattr;
	if (ps_iattr) {
		struct iattr *ps_iattrs = &ps_iattr->ia_iattr;
		ps_iattrs->ia_ctime = ps_iattrs->ia_mtime = CURRENT_TIME;
	}
	return 0;
}