X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vnops.c;h=5d6b0611cf4528868890ef06d391f1cf62465fa0;hb=9623f736d958b4a28613177e03095dbdde0cc4af;hp=363307932f39276faade3c7e511a9b3154d074f8;hpb=2c395def2763ccc7a549d297f7f11bd304caaeae;p=zfs.git diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 3633079..5d6b061 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -2274,7 +2274,7 @@ top: /* * Remove setuid/setgid for non-privileged users */ - secpolicy_setid_clear(attr, cr); + (void) secpolicy_setid_clear(attr, cr); trim_mask = (mask & (ATTR_UID|ATTR_GID)); } else { need_policy = TRUE; @@ -2488,7 +2488,7 @@ top: SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zsb), NULL, &new_mode, sizeof (new_mode)); zp->z_mode = new_mode; - ASSERT3U((uintptr_t)aclp, !=, NULL); + ASSERT3P(aclp, !=, NULL); err = zfs_aclset_common(zp, aclp, cr, tx); ASSERT3U(err, ==, 0); if (zp->z_acl_cached) @@ -2575,7 +2575,7 @@ out: } else { err2 = sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); dmu_tx_commit(tx); - zfs_inode_update(zp); + zfs_inode_update(zp); } out2: @@ -3169,7 +3169,6 @@ top: zfs_dirent_unlock(dl); *ipp = ZTOI(zp); - iput(ZTOI(zp)); if (zsb->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); @@ -3183,8 +3182,9 @@ EXPORT_SYMBOL(zfs_symlink); * Return, in the buffer contained in the provided uio structure, * the symbolic path referred to by ip. * - * IN: dentry - dentry of symbolic link. - * nd - namedata for symlink + * IN: ip - inode of symbolic link + * uio - structure to contain the link path. + * cr - credentials of caller. * * RETURN: 0 if success * error code if failure @@ -3194,47 +3194,29 @@ EXPORT_SYMBOL(zfs_symlink); */ /* ARGSUSED */ int -zfs_follow_link(struct dentry *dentry, struct nameidata *nd) +zfs_readlink(struct inode *ip, uio_t *uio, cred_t *cr) { - struct inode *ip = dentry->d_inode; znode_t *zp = ITOZ(ip); zfs_sb_t *zsb = ITOZSB(ip); - struct iovec iov; - uio_t uio; int error; ZFS_ENTER(zsb); ZFS_VERIFY_ZP(zp); - iov.iov_len = MAXPATHLEN + 1; - iov.iov_base = kmem_zalloc(iov.iov_len, KM_SLEEP); - - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_resid = iov.iov_len; - uio.uio_segflg = UIO_SYSSPACE; - mutex_enter(&zp->z_lock); if (zp->z_is_sa) - error = sa_lookup_uio(zp->z_sa_hdl, SA_ZPL_SYMLINK(zsb), &uio); + error = sa_lookup_uio(zp->z_sa_hdl, + SA_ZPL_SYMLINK(zsb), uio); else - error = zfs_sa_readlink(zp, &uio); + error = zfs_sa_readlink(zp, uio); mutex_exit(&zp->z_lock); ZFS_ACCESSTIME_STAMP(zsb, zp); zfs_inode_update(zp); - - if (error) { - kmem_free(iov.iov_base, iov.iov_len); - nd_set_link(nd, ERR_PTR(error)); - } else { - nd_set_link(nd, iov.iov_base); - } - ZFS_EXIT(zsb); return (error); } -EXPORT_SYMBOL(zfs_follow_link); +EXPORT_SYMBOL(zfs_readlink); /* * Insert a new entry into directory tdip referencing sip. @@ -3542,8 +3524,7 @@ out: */ /*ARGSUSED*/ static int -zfs_putpage(vnode_t *vp, offset_t off, size_t len, int flags, cred_t *cr, - caller_context_t *ct) +zfs_putpage(vnode_t *vp, offset_t off, size_t len, int flags, cred_t *cr) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; @@ -3678,8 +3659,7 @@ EXPORT_SYMBOL(zfs_inactive); */ /* ARGSUSED */ int -zfs_seek(struct inode *ip, offset_t ooff, offset_t *noffp, - caller_context_t *ct) +zfs_seek(struct inode *ip, offset_t ooff, offset_t *noffp) { if (S_ISDIR(ip->i_mode)) return (0); @@ -3694,7 +3674,7 @@ EXPORT_SYMBOL(zfs_seek); */ static int zfs_frlock(vnode_t *vp, int cmd, flock64_t *bfp, int flag, offset_t offset, - flk_callback_t *flk_cbp, cred_t *cr, caller_context_t *ct) + flk_callback_t *flk_cbp, cred_t *cr) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; @@ -3822,7 +3802,7 @@ zfs_fillpage(vnode_t *vp, u_offset_t off, struct seg *seg, static int zfs_getpage(vnode_t *vp, offset_t off, size_t len, uint_t *protp, page_t *pl[], size_t plsz, struct seg *seg, caddr_t addr, - enum seg_rw rw, cred_t *cr, caller_context_t *ct) + enum seg_rw rw, cred_t *cr) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; @@ -3910,8 +3890,7 @@ out: /*ARGSUSED*/ static int zfs_map(vnode_t *vp, offset_t off, struct as *as, caddr_t *addrp, - size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cr, - caller_context_t *ct) + size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cr) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; @@ -3985,8 +3964,7 @@ zfs_map(vnode_t *vp, offset_t off, struct as *as, caddr_t *addrp, /* ARGSUSED */ static int zfs_addmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr, - size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cr, - caller_context_t *ct) + size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cr) { uint64_t pages = btopr(len); @@ -4018,8 +3996,7 @@ zfs_addmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr, /* ARGSUSED */ static int zfs_delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr, - size_t len, uint_t prot, uint_t maxprot, uint_t flags, cred_t *cr, - caller_context_t *ct) + size_t len, uint_t prot, uint_t maxprot, uint_t flags, cred_t *cr) { uint64_t pages = btopr(len);