cred_t *cr = CRED();
struct inode *ip;
int error;
+ fstrans_cookie_t cookie;
if (dlen(dentry) > ZFS_MAXNAMELEN)
return (ERR_PTR(-ENAMETOOLONG));
crhold(cr);
+ cookie = spl_fstrans_mark();
error = -zfs_lookup(dir, dname(dentry), &ip, 0, cr, NULL, NULL);
+ spl_fstrans_unmark(cookie);
ASSERT3S(error, <=, 0);
crfree(cr);
struct inode *ip;
vattr_t *vap;
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
vap = kmem_zalloc(sizeof (vattr_t), KM_SLEEP);
zpl_vap_init(vap, dir, mode, cr);
+ cookie = spl_fstrans_mark();
error = -zfs_create(dir, dname(dentry), vap, 0, mode, &ip, cr, 0, NULL);
if (error == 0) {
VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
d_instantiate(dentry, ip);
}
+ spl_fstrans_unmark(cookie);
kmem_free(vap, sizeof (vattr_t));
crfree(cr);
ASSERT3S(error, <=, 0);
struct inode *ip;
vattr_t *vap;
int error;
+ fstrans_cookie_t cookie;
/*
* We currently expect Linux to supply rdev=0 for all sockets
zpl_vap_init(vap, dir, mode, cr);
vap->va_rdev = rdev;
+ cookie = spl_fstrans_mark();
error = -zfs_create(dir, dname(dentry), vap, 0, mode, &ip, cr, 0, NULL);
if (error == 0) {
VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
d_instantiate(dentry, ip);
}
+ spl_fstrans_unmark(cookie);
kmem_free(vap, sizeof (vattr_t));
crfree(cr);
ASSERT3S(error, <=, 0);
{
cred_t *cr = CRED();
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
+ cookie = spl_fstrans_mark();
error = -zfs_remove(dir, dname(dentry), cr);
+ spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);
vattr_t *vap;
struct inode *ip;
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
vap = kmem_zalloc(sizeof (vattr_t), KM_SLEEP);
zpl_vap_init(vap, dir, mode | S_IFDIR, cr);
+ cookie = spl_fstrans_mark();
error = -zfs_mkdir(dir, dname(dentry), vap, &ip, cr, 0, NULL);
if (error == 0) {
VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
d_instantiate(dentry, ip);
}
+ spl_fstrans_unmark(cookie);
kmem_free(vap, sizeof (vattr_t));
crfree(cr);
ASSERT3S(error, <=, 0);
{
cred_t *cr = CRED();
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
+ cookie = spl_fstrans_mark();
error = -zfs_rmdir(dir, dname(dentry), NULL, cr, 0);
+ spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);
{
boolean_t issnap = ITOZSB(dentry->d_inode)->z_issnap;
int error;
+ fstrans_cookie_t cookie;
/*
* Ensure MNT_SHRINKABLE is set on snapshots to ensure they are
if (unlikely(issnap && !(mnt->mnt_flags & MNT_SHRINKABLE)))
mnt->mnt_flags |= MNT_SHRINKABLE;
+ cookie = spl_fstrans_mark();
error = -zfs_getattr_fast(dentry->d_inode, stat);
+ spl_fstrans_unmark(cookie);
ASSERT3S(error, <=, 0);
return (error);
cred_t *cr = CRED();
vattr_t *vap;
int error;
+ fstrans_cookie_t cookie;
error = inode_change_ok(ip, ia);
if (error)
vap->va_mtime = ia->ia_mtime;
vap->va_ctime = ia->ia_ctime;
+ cookie = spl_fstrans_mark();
error = -zfs_setattr(ip, vap, 0, cr);
if (!error && (ia->ia_valid & ATTR_MODE))
error = zpl_chmod_acl(ip);
+ spl_fstrans_unmark(cookie);
kmem_free(vap, sizeof (vattr_t));
crfree(cr);
ASSERT3S(error, <=, 0);
{
cred_t *cr = CRED();
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
+ cookie = spl_fstrans_mark();
error = -zfs_rename(sdip, dname(sdentry), tdip, dname(tdentry), cr, 0);
+ spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);
vattr_t *vap;
struct inode *ip;
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
vap = kmem_zalloc(sizeof (vattr_t), KM_SLEEP);
zpl_vap_init(vap, dir, S_IFLNK | S_IRWXUGO, cr);
+ cookie = spl_fstrans_mark();
error = -zfs_symlink(dir, dname(dentry), vap, (char *)name, &ip, cr, 0);
if (error == 0) {
VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
d_instantiate(dentry, ip);
}
+ spl_fstrans_unmark(cookie);
kmem_free(vap, sizeof (vattr_t));
crfree(cr);
ASSERT3S(error, <=, 0);
uio_t uio;
char *link;
int error;
+ fstrans_cookie_t cookie;
crhold(cr);
uio.uio_resid = (MAXPATHLEN - 1);
uio.uio_segflg = UIO_SYSSPACE;
+ cookie = spl_fstrans_mark();
error = -zfs_readlink(ip, &uio, cr);
+ spl_fstrans_unmark(cookie);
if (error) {
kmem_free(link, MAXPATHLEN);
nd_set_link(nd, ERR_PTR(error));
cred_t *cr = CRED();
struct inode *ip = old_dentry->d_inode;
int error;
+ fstrans_cookie_t cookie;
if (ip->i_nlink >= ZFS_LINK_MAX)
return (-EMLINK);
ip->i_ctime = CURRENT_TIME_SEC;
igrab(ip); /* Use ihold() if available */
+ cookie = spl_fstrans_mark();
error = -zfs_link(dir, ip, dname(dentry), cr);
if (error) {
iput(ip);
d_instantiate(dentry, ip);
out:
+ spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);
{
cred_t *cr = CRED();
flock64_t bf;
+ fstrans_cookie_t cookie;
ASSERT3S(start, <=, end);
bf.l_start = start;
bf.l_len = end - start;
bf.l_pid = 0;
+ cookie = spl_fstrans_mark();
zfs_space(ip, F_FREESP, &bf, FWRITE, start, cr);
+ spl_fstrans_unmark(cookie);
crfree(cr);
}