Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_syscalls.c
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | static int kern_fhlinkat(struct thread *td, int fd, const char *path, | ||||
enum uio_seg pathseg, fhandle_t *fhp); | enum uio_seg pathseg, fhandle_t *fhp); | ||||
static int kern_getfhat(struct thread *td, int flags, int fd, | static int kern_getfhat(struct thread *td, int flags, int fd, | ||||
const char *path, enum uio_seg pathseg, fhandle_t *fhp); | const char *path, enum uio_seg pathseg, fhandle_t *fhp); | ||||
static int kern_readlink_vp(struct vnode *vp, char *buf, enum uio_seg bufseg, | static int kern_readlink_vp(struct vnode *vp, char *buf, enum uio_seg bufseg, | ||||
size_t count, struct thread *td); | size_t count, struct thread *td); | ||||
static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, | static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, | ||||
const char *path, enum uio_seg segflag); | const char *path, enum uio_seg segflag); | ||||
/* | |||||
* Sync each mounted filesystem. | |||||
*/ | |||||
#ifndef _SYS_SYSPROTO_H_ | |||||
struct sync_args { | |||||
int dummy; | |||||
}; | |||||
#endif | |||||
/* ARGSUSED */ | |||||
int | int | ||||
sys_sync(struct thread *td, struct sync_args *uap) | kern_sync(struct thread *td) | ||||
{ | { | ||||
struct mount *mp, *nmp; | struct mount *mp, *nmp; | ||||
int save; | int save; | ||||
mtx_lock(&mountlist_mtx); | mtx_lock(&mountlist_mtx); | ||||
for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { | for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { | ||||
if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { | if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { | ||||
nmp = TAILQ_NEXT(mp, mnt_list); | nmp = TAILQ_NEXT(mp, mnt_list); | ||||
continue; | continue; | ||||
} | } | ||||
if ((mp->mnt_flag & MNT_RDONLY) == 0 && | if ((mp->mnt_flag & MNT_RDONLY) == 0 && | ||||
vn_start_write(NULL, &mp, V_NOWAIT) == 0) { | vn_start_write(NULL, &mp, V_NOWAIT) == 0) { | ||||
save = curthread_pflags_set(TDP_SYNCIO); | save = curthread_pflags_set(TDP_SYNCIO); | ||||
vfs_msync(mp, MNT_NOWAIT); | vfs_msync(mp, MNT_NOWAIT); | ||||
VFS_SYNC(mp, MNT_NOWAIT); | VFS_SYNC(mp, MNT_NOWAIT); | ||||
curthread_pflags_restore(save); | curthread_pflags_restore(save); | ||||
vn_finished_write(mp); | vn_finished_write(mp); | ||||
} | } | ||||
mtx_lock(&mountlist_mtx); | mtx_lock(&mountlist_mtx); | ||||
nmp = TAILQ_NEXT(mp, mnt_list); | nmp = TAILQ_NEXT(mp, mnt_list); | ||||
vfs_unbusy(mp); | vfs_unbusy(mp); | ||||
} | } | ||||
mtx_unlock(&mountlist_mtx); | mtx_unlock(&mountlist_mtx); | ||||
return (0); | return (0); | ||||
} | |||||
/* | |||||
* Sync each mounted filesystem. | |||||
*/ | |||||
#ifndef _SYS_SYSPROTO_H_ | |||||
struct sync_args { | |||||
int dummy; | |||||
}; | |||||
#endif | |||||
/* ARGSUSED */ | |||||
int | |||||
sys_sync(struct thread *td, struct sync_args *uap) | |||||
{ | |||||
return (kern_sync(td)); | |||||
} | } | ||||
/* | /* | ||||
* Change filesystem quotas. | * Change filesystem quotas. | ||||
*/ | */ | ||||
#ifndef _SYS_SYSPROTO_H_ | #ifndef _SYS_SYSPROTO_H_ | ||||
struct quotactl_args { | struct quotactl_args { | ||||
char *path; | char *path; | ||||
▲ Show 20 Lines • Show All 4,761 Lines • Show Last 20 Lines |