+zpl_open(struct inode *ip, struct file *filp)
+{
+ cred_t *cr;
+ int error;
+
+ cr = (cred_t *)get_current_cred();
+ error = -zfs_open(ip, filp->f_mode, filp->f_flags, cr);
+ put_cred(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;
+ int error;
+
+ cr = (cred_t *)get_current_cred();
+ error = -zfs_close(ip, filp->f_flags, cr);
+ put_cred(cr);
+ ASSERT3S(error, <=, 0);
+
+ return (error);
+}
+
+static int