@@ -364,3 +364,28 @@ xfs_parent_set(
return xfs_attr_set(&scr->args);
}
+
+/*
+ * Remove the parent pointer (@rec -> @name) from @ip immediately. Caller must
+ * not have a transaction or hold the ILOCK. The update will not use logged
+ * xattrs. This is for specialized repair functions only. The scratchpad need
+ * not be initialized.
+ */
+int
+xfs_parent_unset(
+ struct xfs_inode *ip,
+ const struct xfs_parent_name_irec *pptr,
+ struct xfs_parent_scratch *scr)
+{
+ xfs_parent_irec_to_disk(&scr->rec, NULL, NULL, pptr);
+
+ memset(&scr->args, 0, sizeof(struct xfs_da_args));
+ scr->args.attr_filter = XFS_ATTR_PARENT;
+ scr->args.dp = ip;
+ scr->args.geo = ip->i_mount->m_attr_geo;
+ scr->args.name = (const unsigned char *)&scr->rec;
+ scr->args.namelen = sizeof(struct xfs_parent_name_rec);
+ scr->args.whichfork = XFS_ATTR_FORK;
+
+ return xfs_attr_set(&scr->args);
+}
@@ -117,4 +117,8 @@ int xfs_parent_set(struct xfs_inode *ip,
const struct xfs_parent_name_irec *pptr,
struct xfs_parent_scratch *scratch);
+int xfs_parent_unset(struct xfs_inode *ip,
+ const struct xfs_parent_name_irec *rec,
+ struct xfs_parent_scratch *scratch);
+
#endif /* __XFS_PARENT_H__ */