aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_vnops.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2016-04-13 08:55:35 -0700
committerBrian Behlendorf <[email protected]>2016-04-21 09:49:25 -0700
commitda5e151f207ff1bc4972ce74a3a85e442ffd5a03 (patch)
tree59fcc326b6ad69b36bc9f06bf1dd25a23afee34c /module/zfs/zfs_vnops.c
parent8fc5674c522e22f0b97e4714bf5410e24d481afa (diff)
Add pn_alloc()/pn_free() functions
In order to remove the HAVE_PN_UTILS wrappers the pn_alloc() and pn_free() functions must be implemented. The existing illumos implementation were used for this purpose. The `flags` argument which was used in places wrapped by the HAVE_PN_UTILS condition has beed added back to zfs_remove() and zfs_link() functions. This removes a small point of divergence between the ZoL code and upstream. Signed-off-by: Brian Behlendorf <[email protected]> Closes #4522
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r--module/zfs/zfs_vnops.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 3c3d587e8..7a8cef017 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -1512,7 +1512,7 @@ uint64_t null_xattr = 0;
/*ARGSUSED*/
int
-zfs_remove(struct inode *dip, char *name, cred_t *cr)
+zfs_remove(struct inode *dip, char *name, cred_t *cr, int flags)
{
znode_t *zp, *dzp = ITOZ(dip);
znode_t *xzp;
@@ -1528,9 +1528,7 @@ zfs_remove(struct inode *dip, char *name, cred_t *cr)
boolean_t unlinked, toobig = FALSE;
uint64_t txtype;
pathname_t *realnmp = NULL;
-#ifdef HAVE_PN_UTILS
pathname_t realnm;
-#endif /* HAVE_PN_UTILS */
int error;
int zflg = ZEXISTS;
boolean_t waited = B_FALSE;
@@ -1539,13 +1537,11 @@ zfs_remove(struct inode *dip, char *name, cred_t *cr)
ZFS_VERIFY_ZP(dzp);
zilog = zsb->z_log;
-#ifdef HAVE_PN_UTILS
if (flags & FIGNORECASE) {
zflg |= ZCILOOK;
pn_alloc(&realnm);
realnmp = &realnm;
}
-#endif /* HAVE_PN_UTILS */
top:
xattr_obj = 0;
@@ -1555,10 +1551,8 @@ top:
*/
if ((error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg,
NULL, realnmp))) {
-#ifdef HAVE_PN_UTILS
if (realnmp)
pn_free(realnmp);
-#endif /* HAVE_PN_UTILS */
ZFS_EXIT(zsb);
return (error);
}
@@ -1642,10 +1636,8 @@ top:
dmu_tx_abort(tx);
goto top;
}
-#ifdef HAVE_PN_UTILS
if (realnmp)
pn_free(realnmp);
-#endif /* HAVE_PN_UTILS */
dmu_tx_abort(tx);
ZFS_EXIT(zsb);
return (error);
@@ -1711,18 +1703,14 @@ top:
}
txtype = TX_REMOVE;
-#ifdef HAVE_PN_UTILS
if (flags & FIGNORECASE)
txtype |= TX_CI;
-#endif /* HAVE_PN_UTILS */
zfs_log_remove(zilog, tx, txtype, dzp, name, obj);
dmu_tx_commit(tx);
out:
-#ifdef HAVE_PN_UTILS
if (realnmp)
pn_free(realnmp);
-#endif /* HAVE_PN_UTILS */
zfs_dirent_unlock(dl);
zfs_inode_update(dzp);
@@ -3782,7 +3770,8 @@ EXPORT_SYMBOL(zfs_readlink);
*/
/* ARGSUSED */
int
-zfs_link(struct inode *tdip, struct inode *sip, char *name, cred_t *cr)
+zfs_link(struct inode *tdip, struct inode *sip, char *name, cred_t *cr,
+ int flags)
{
znode_t *dzp = ITOZ(tdip);
znode_t *tzp, *szp;
@@ -3840,10 +3829,8 @@ zfs_link(struct inode *tdip, struct inode *sip, char *name, cred_t *cr)
ZFS_EXIT(zsb);
return (SET_ERROR(EILSEQ));
}
-#ifdef HAVE_PN_UTILS
if (flags & FIGNORECASE)
zf |= ZCILOOK;
-#endif /* HAVE_PN_UTILS */
/*
* We do not support links between attributes and non-attributes
@@ -3900,10 +3887,8 @@ top:
if (error == 0) {
uint64_t txtype = TX_LINK;
-#ifdef HAVE_PN_UTILS
if (flags & FIGNORECASE)
txtype |= TX_CI;
-#endif /* HAVE_PN_UTILS */
zfs_log_link(zilog, tx, txtype, dzp, szp, name);
}