X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vnops.c;h=e5e187b15a45a898e07e7da933ebd897057f3f5c;hb=cb28b3494e88e0e43c43588fccfa6526344b9a64;hp=44bae8e34984b41e1347633b8117a11f91f7d0f6;hpb=149e873ab174ded1f632f2b2eb2267593517c7ca;p=zfs.git diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 44bae8e..e5e187b 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include @@ -443,7 +444,7 @@ offset_t zfs_read_chunk_size = 1024 * 1024; /* Tunable */ * vp - atime updated if byte count > 0 */ /* ARGSUSED */ -static int +int zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct) { znode_t *zp = VTOZ(vp); @@ -563,9 +564,11 @@ out: zfs_range_unlock(rl); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); + zfs_inode_update(zp); ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_read); /* * Write the bytes to a file. @@ -587,7 +590,7 @@ out: */ /* ARGSUSED */ -static int +int zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct) { znode_t *zp = VTOZ(vp); @@ -936,9 +939,11 @@ again: zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, zp->z_id); + zfs_inode_update(zp); ZFS_EXIT(zfsvfs); return (0); } +EXPORT_SYMBOL(zfs_write); void zfs_get_done(zgd_t *zgd, int error) @@ -1152,7 +1157,7 @@ specvp_check(vnode_t **vpp, cred_t *cr) * NA */ /* ARGSUSED */ -static int +int zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct pathname *pnp, int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct, int *direntflags, pathname_t *realpnp) @@ -1263,12 +1268,17 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct pathname *pnp, } error = zfs_dirlook(zdp, nm, vpp, flags, direntflags, realpnp); - if (error == 0) + if (error == 0) { + if (*vpp) + zfs_inode_update(VTOZ(*vpp)); + error = specvp_check(vpp, cr); + } ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_lookup); /* * Attempt to create a new entry in a directory. If the entry @@ -1296,8 +1306,8 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct pathname *pnp, */ /* ARGSUSED */ -static int -zfs_create(vnode_t *dvp, char *name, vattr_t *vap, vcexcl_t excl, +int +zfs_create(vnode_t *dvp, char *name, vattr_t *vap, int excl, int mode, vnode_t **vpp, cred_t *cr, int flag, caller_context_t *ct, vsecattr_t *vsecp) { @@ -1519,6 +1529,8 @@ out: if (zp) VN_RELE(ZTOV(zp)); } else { + zfs_inode_update(dzp); + zfs_inode_update(zp); *vpp = ZTOV(zp); error = specvp_check(vpp, cr); } @@ -1529,6 +1541,7 @@ out: ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_create); /* * Remove an entry from a directory. @@ -1550,7 +1563,7 @@ out: uint64_t null_xattr = 0; /*ARGSUSED*/ -static int +int zfs_remove(vnode_t *dvp, char *name, cred_t *cr, caller_context_t *ct, int flags) { @@ -1748,6 +1761,10 @@ out: pn_free(realnmp); zfs_dirent_unlock(dl); + zfs_inode_update(dzp); + zfs_inode_update(zp); + if (xzp) + zfs_inode_update(xzp); if (!delete_now) VN_RELE(vp); @@ -1760,6 +1777,7 @@ out: ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_remove); /* * Create a new directory and insert it into dvp using the name @@ -1782,7 +1800,7 @@ out: * vp - ctime|mtime|atime updated */ /*ARGSUSED*/ -static int +int zfs_mkdir(vnode_t *dvp, char *dirname, vattr_t *vap, vnode_t **vpp, cred_t *cr, caller_context_t *ct, int flags, vsecattr_t *vsecp) { @@ -1939,9 +1957,12 @@ top: if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); + zfs_inode_update(dzp); + zfs_inode_update(zp); ZFS_EXIT(zfsvfs); return (0); } +EXPORT_SYMBOL(zfs_mkdir); /* * Remove a directory subdir entry. If the current working @@ -1962,7 +1983,7 @@ top: * dvp - ctime|mtime updated */ /*ARGSUSED*/ -static int +int zfs_rmdir(vnode_t *dvp, char *name, vnode_t *cwd, cred_t *cr, caller_context_t *ct, int flags) { @@ -2067,9 +2088,12 @@ out: if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); + zfs_inode_update(dzp); + zfs_inode_update(zp); ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_rmdir); /* * Read as many directory entries as will fit into the provided @@ -2364,7 +2388,7 @@ update: ulong_t zfs_fsync_sync_cnt = 4; -static int +int zfs_fsync(vnode_t *vp, int syncflag, cred_t *cr, caller_context_t *ct) { znode_t *zp = VTOZ(vp); @@ -2390,6 +2414,7 @@ zfs_fsync(vnode_t *vp, int syncflag, cred_t *cr, caller_context_t *ct) } return (0); } +EXPORT_SYMBOL(zfs_fsync); /* @@ -2408,7 +2433,7 @@ zfs_fsync(vnode_t *vp, int syncflag, cred_t *cr, caller_context_t *ct) * RETURN: 0 (always succeeds) */ /* ARGSUSED */ -static int +int zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, caller_context_t *ct) { @@ -2594,6 +2619,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, ZFS_EXIT(zfsvfs); return (0); } +EXPORT_SYMBOL(zfs_getattr); /* * Set the file attributes to the values contained in the @@ -2614,7 +2640,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, * vp - ctime updated, mtime updated if size changed. */ /* ARGSUSED */ -static int +int zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, caller_context_t *ct) { @@ -3217,6 +3243,7 @@ out: } else { err2 = sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); dmu_tx_commit(tx); + zfs_inode_update(zp); } out2: @@ -3226,6 +3253,7 @@ out2: ZFS_EXIT(zfsvfs); return (err); } +EXPORT_SYMBOL(zfs_setattr); typedef struct zfs_zlock { krwlock_t *zl_rwlock; /* lock we acquired */ @@ -3343,7 +3371,7 @@ zfs_rename_lock(znode_t *szp, znode_t *tdzp, znode_t *sdzp, zfs_zlock_t **zlpp) * sdvp,tdvp - ctime|mtime updated */ /*ARGSUSED*/ -static int +int zfs_rename(vnode_t *sdvp, char *snm, vnode_t *tdvp, char *tnm, cred_t *cr, caller_context_t *ct, int flags) { @@ -3663,13 +3691,19 @@ out: zfs_dirent_unlock(sdl); zfs_dirent_unlock(tdl); + zfs_inode_update(sdzp); if (sdzp == tdzp) rw_exit(&sdzp->z_name_lock); + if (sdzp != tdzp) + zfs_inode_update(tdzp); + zfs_inode_update(szp); VN_RELE(ZTOV(szp)); - if (tzp) + if (tzp) { + zfs_inode_update(tzp); VN_RELE(ZTOV(tzp)); + } if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); @@ -3677,6 +3711,7 @@ out: ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_rename); /* * Insert the indicated symbolic reference entry into the directory. @@ -3696,7 +3731,7 @@ out: * dvp - ctime|mtime updated */ /*ARGSUSED*/ -static int +int zfs_symlink(vnode_t *dvp, char *name, vattr_t *vap, char *link, cred_t *cr, caller_context_t *ct, int flags) { @@ -3816,6 +3851,9 @@ top: txtype |= TX_CI; zfs_log_symlink(zilog, tx, txtype, dzp, zp, name, link); + zfs_inode_update(dzp); + zfs_inode_update(zp); + zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); @@ -3830,6 +3868,7 @@ top: ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_symlink); /* * Return, in the buffer contained in the provided uio structure, @@ -3849,7 +3888,7 @@ top: * vp - atime updated */ /* ARGSUSED */ -static int +int zfs_readlink(vnode_t *vp, uio_t *uio, cred_t *cr, caller_context_t *ct) { znode_t *zp = VTOZ(vp); @@ -3869,9 +3908,11 @@ zfs_readlink(vnode_t *vp, uio_t *uio, cred_t *cr, caller_context_t *ct) ZFS_ACCESSTIME_STAMP(zfsvfs, zp); + zfs_inode_update(zp); ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_readlink); /* * Insert a new entry into directory tdvp referencing svp. @@ -3890,7 +3931,7 @@ zfs_readlink(vnode_t *vp, uio_t *uio, cred_t *cr, caller_context_t *ct) * svp - ctime updated */ /* ARGSUSED */ -static int +int zfs_link(vnode_t *tdvp, vnode_t *svp, char *name, cred_t *cr, caller_context_t *ct, int flags) { @@ -4023,9 +4064,12 @@ top: if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); + zfs_inode_update(dzp); + zfs_inode_update(szp); ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_link); /* * zfs_null_putapage() is used when the file system has been force @@ -4323,6 +4367,7 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct) zfs_zinactive(zp); rw_exit(&zfsvfs->z_teardown_inactive_lock); } +EXPORT_SYMBOL(zfs_inactive); /* * Bounds-check the seek operation. @@ -4711,7 +4756,7 @@ zfs_delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr, * vp - ctime|mtime updated */ /* ARGSUSED */ -static int +int zfs_space(vnode_t *vp, int cmd, flock64_t *bfp, int flag, offset_t offset, cred_t *cr, caller_context_t *ct) { @@ -4746,9 +4791,10 @@ zfs_space(vnode_t *vp, int cmd, flock64_t *bfp, int flag, ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_space); /*ARGSUSED*/ -static int +int zfs_fid(vnode_t *vp, fid_t *fidp, caller_context_t *ct) { znode_t *zp = VTOZ(vp); @@ -4807,6 +4853,7 @@ zfs_fid(vnode_t *vp, fid_t *fidp, caller_context_t *ct) ZFS_EXIT(zfsvfs); return (0); } +EXPORT_SYMBOL(zfs_fid); static int zfs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, @@ -4879,7 +4926,7 @@ zfs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, } /*ARGSUSED*/ -static int +int zfs_getsecattr(vnode_t *vp, vsecattr_t *vsecp, int flag, cred_t *cr, caller_context_t *ct) { @@ -4895,9 +4942,10 @@ zfs_getsecattr(vnode_t *vp, vsecattr_t *vsecp, int flag, cred_t *cr, return (error); } +EXPORT_SYMBOL(zfs_getsecattr); /*ARGSUSED*/ -static int +int zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int flag, cred_t *cr, caller_context_t *ct) { @@ -4918,6 +4966,7 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int flag, cred_t *cr, ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_setsecattr); /* * Tunable, both must be a power of 2.