Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_node.c
Show First 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | fuse_vnode_size(struct vnode *vp, off_t *filesize, struct ucred *cred, | ||||
if (!error) | if (!error) | ||||
*filesize = fvdat->cached_attrs.va_size; | *filesize = fvdat->cached_attrs.va_size; | ||||
return error; | return error; | ||||
} | } | ||||
void | void | ||||
fuse_vnode_undirty_cached_timestamps(struct vnode *vp) | fuse_vnode_undirty_cached_timestamps(struct vnode *vp, bool atime) | ||||
{ | { | ||||
struct fuse_vnode_data *fvdat = VTOFUD(vp); | struct fuse_vnode_data *fvdat = VTOFUD(vp); | ||||
fvdat->flag &= ~(FN_MTIMECHANGE | FN_CTIMECHANGE); | fvdat->flag &= ~(FN_MTIMECHANGE | FN_CTIMECHANGE); | ||||
if (atime) | |||||
fvdat->flag &= ~FN_ATIMECHANGE; | |||||
} | } | ||||
/* Update a fuse file's cached timestamps */ | /* Update a fuse file's cached timestamps */ | ||||
void | void | ||||
fuse_vnode_update(struct vnode *vp, int flags) | fuse_vnode_update(struct vnode *vp, int flags) | ||||
{ | { | ||||
struct fuse_vnode_data *fvdat = VTOFUD(vp); | struct fuse_vnode_data *fvdat = VTOFUD(vp); | ||||
struct fuse_data *data = fuse_get_mpdata(vnode_mount(vp)); | struct mount *mp = vnode_mount(vp); | ||||
struct fuse_data *data = fuse_get_mpdata(mp); | |||||
struct timespec ts; | struct timespec ts; | ||||
vfs_timestamp(&ts); | vfs_timestamp(&ts); | ||||
if (data->time_gran > 1) | if (data->time_gran > 1) | ||||
ts.tv_nsec = rounddown(ts.tv_nsec, data->time_gran); | ts.tv_nsec = rounddown(ts.tv_nsec, data->time_gran); | ||||
if (mp->mnt_flag & MNT_NOATIME) | |||||
flags &= ~FN_ATIMECHANGE; | |||||
if (flags & FN_ATIMECHANGE) | |||||
fvdat->cached_attrs.va_atime = ts; | |||||
if (flags & FN_MTIMECHANGE) | if (flags & FN_MTIMECHANGE) | ||||
fvdat->cached_attrs.va_mtime = ts; | fvdat->cached_attrs.va_mtime = ts; | ||||
if (flags & FN_CTIMECHANGE) | if (flags & FN_CTIMECHANGE) | ||||
fvdat->cached_attrs.va_ctime = ts; | fvdat->cached_attrs.va_ctime = ts; | ||||
fvdat->flag |= flags; | fvdat->flag |= flags; | ||||
} | } | ||||
Show All 11 Lines |