Patch review reguest: vn_pages_remove()
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Aug 24 21:26:47 UTC 2011
On Wed, Aug 24, 2011 at 11:07:46PM +0200, Martin Matuska wrote:
> A generalization of vn_pages_remove() is attached + ZTOV(vp) suggested
> change by pjd.
> Is this we have been talking about?
[...]
> --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c (revision 225140)
> +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c (working copy)
> @@ -1259,6 +1259,7 @@ zfs_rezget(znode_t *zp)
> zfsvfs_t *zfsvfs = zp->z_zfsvfs;
> dmu_object_info_t doi;
> dmu_buf_t *db;
> + vnode_t *vp = ZTOV(zp);
Could you move the assignment just before it is used?
We put a hold on znode and I'd prefer not to obtain its vnode pointer
before we do that. Just in case.
> uint64_t obj_num = zp->z_id;
> uint64_t mode, size;
> sa_bulk_attr_t bulk[8];
> @@ -1334,8 +1335,8 @@ zfs_rezget(znode_t *zp)
> * that for example regular file was replaced with directory
> * which has the same object number.
> */
I'll move it here:
vp = ZTOV(zp);
> - if (ZTOV(zp) != NULL &&
> - ZTOV(zp)->v_type != IFTOVT((mode_t)zp->z_mode)) {
> + if (vp != NULL &&
> + vp->v_type != IFTOVT((mode_t)zp->z_mode)) {
Those two lines should now fit into one.
Other than that looks good.
--
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/zfs-devel/attachments/20110824/62807870/attachment.pgp
More information about the zfs-devel
mailing list