Thread (80 messages) 80 messages, 8 authors, 2011-07-11

Re: [PATCH 14/27] xfs: cleanup shortform directory inode number handling

From: Christoph Hellwig <hch@infradead.org>
Date: 2011-06-30 07:39:39

quoted
+static xfs_ino_t
Extra line there...
Fixed.
quoted
+}
+static void
And none there.
Fixed.
quoted
+xfs_dir2_sf_put_inumber(
+	struct xfs_dir2_sf	*sfp,
+	xfs_dir2_inou_t		*to,
+	xfs_ino_t		ino)
+{
+	if (sfp->hdr.i8count)
+		XFS_PUT_DIR_INO8(ino, to->i8);
+	else
+		XFS_PUT_DIR_INO4(ino, to->i4);
+}
Also, xfs_dir2_sf_get_ino() vs xfs_dir2_sf_put_inumber() - either
use _ino or _inumber as the suffix for both. _ino is probably more
consistent with the other functions...
xfs_dir2_sf_put_inumber already exists in the current code and I just
moved it blindly.  I've renamed it to xfs_dir2_sf_put_ino for the
next version.
quoted
+
+xfs_ino_t
+xfs_dir2_sf_get_parent_ino(
+	struct xfs_dir2_sf	*sfp)
+{
+	return xfs_dir2_sf_get_ino(sfp, &sfp->hdr.parent);
+}
+
+
Extra whitespace.
Fixed.
quoted
+static void
+xfs_dir2_sf_put_parent_ino(
+	struct xfs_dir2_sf	*sfp,
+	xfs_ino_t		ino)
+{
+	xfs_dir2_sf_put_inumber(sfp, &sfp->hdr.parent, ino);
+}
+
+
Extra whitespace.
Fixed.
quoted
+/*
+ * In short-form directory entries the inode numbers are stored at variable
+ * offset behind the entry name.  The inode numbers may only be accessed
+ * through the helpers below.
+ */
+
Extra whitespace.
Fixed.
quoted
+static xfs_dir2_inou_t *
+xfs_dir2_sf_inop(
+	struct xfs_dir2_sf_entry *sfep)
+{
+	return (xfs_dir2_inou_t *)&sfep->name[sfep->namelen];
+}
Probably should be called xfs_dir2_sfe_inop()  because it takes a
xfs_dir2_sf_entry, similar to the following functions use "sfe".
Ok.
quoted
+
+xfs_ino_t
+xfs_dir2_sfe_get_ino(
+	struct xfs_dir2_sf	*sfp,
+	struct xfs_dir2_sf_entry *sfep)
+{
+	return xfs_dir2_sf_get_ino(sfp, xfs_dir2_sf_inop(sfep));
+}
+
+static void
+xfs_dir2_sfe_put_ino(
+	struct xfs_dir2_sf	*sfp,
+	struct xfs_dir2_sf_entry *sfep,
+	xfs_ino_t		ino)
+{
+	xfs_dir2_sf_put_inumber(sfp, xfs_dir2_sf_inop(sfep), ino);
+}
+
+
Extra whitespace.
Fixed.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help