+zpl_open(struct inode *ip, struct file *filp)
+{
+ cred_t *cr = CRED();
+ int error;
+
+ crhold(cr);
+ error = -zfs_open(ip, filp->f_mode, filp->f_flags, cr);
+ crfree(cr);
+ ASSERT3S(error, <=, 0);
+
+ if (error)
+ return (error);
+
+ return generic_file_open(ip, filp);
+}
+
+static int
+zpl_release(struct inode *ip, struct file *filp)
+{
+ cred_t *cr = CRED();
+ int error;
+
+ crhold(cr);
+ error = -zfs_close(ip, filp->f_flags, cr);
+ crfree(cr);
+ ASSERT3S(error, <=, 0);
+
+ return (error);
+}
+
+static int