X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..7e41aa883dd258f888d0470250eead40a53ef1f5:/bsd/sys/mount_internal.h diff --git a/bsd/sys/mount_internal.h b/bsd/sys/mount_internal.h index ccf31dd9a..2f966ca5d 100644 --- a/bsd/sys/mount_internal.h +++ b/bsd/sys/mount_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2011 Apple Inc. All rights reserved. + * Copyright (c) 2000-2014 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -84,6 +84,7 @@ #include /* XXX for AF_MAX */ #include #include +#include struct label; @@ -134,7 +135,10 @@ struct mount { uint32_t mnt_ioflags; /* flags for underlying device */ pending_io_t mnt_pending_write_size __attribute__((aligned(sizeof(pending_io_t)))); /* byte count of pending writes */ pending_io_t mnt_pending_read_size __attribute__((aligned(sizeof(pending_io_t)))); /* byte count of pending reads */ - + struct timeval mnt_last_write_issued_timestamp; + struct timeval mnt_last_write_completed_timestamp; + int64_t mnt_max_swappin_available; + lck_rw_t mnt_rwlock; /* mutex readwrite lock */ lck_mtx_t mnt_renamelock; /* mutex that serializes renames that change shape of tree */ vnode_t mnt_devvp; /* the device mounted on for local file systems */ @@ -187,15 +191,6 @@ struct mount { * volumes marked 'MNTK_AUTH_OPAQUE'. */ int mnt_authcache_ttl; - /* - * The proc structure pointer and process ID form a - * sufficiently unique duple identifying the process - * hosting this mount point. Set by vfs_markdependency() - * and utilized in new_vnode() to avoid reclaiming vnodes - * with this dependency (radar 5192010). - */ - pid_t mnt_dependent_pid; - void *mnt_dependent_process; char fstypename_override[MFSTYPENAMELEN]; }; @@ -210,6 +205,10 @@ struct mount { */ #define MNT_IOFLAGS_FUA_SUPPORTED 0x00000001 #define MNT_IOFLAGS_UNMAP_SUPPORTED 0x00000002 +#define MNT_IOFLAGS_IOSCHED_SUPPORTED 0x00000004 +#define MNT_IOFLAGS_CSUNMAP_SUPPORTED 0x00000008 +#define MNT_IOFLAGS_SWAPPIN_SUPPORTED 0x00000010 +#define MNT_IOFLAGS_FUSION_DRIVE 0x00000020 /* * ioqueue depth for devices that don't report one @@ -235,6 +234,7 @@ extern struct mount * dead_mountp; * because the bits here were broken out from the high bits * of the mount flags. */ +#define MNTK_SWAP_MOUNT 0x00000100 /* we are swapping to this mount */ #define MNTK_DENY_READDIREXT 0x00000200 /* Deny Extended-style readdir's for this volume */ #define MNTK_PERMIT_UNMOUNT 0x00000400 /* Allow (non-forced) unmounts by UIDs other than the one that mounted the volume */ #ifdef NFSCLIENT @@ -260,7 +260,6 @@ extern struct mount * dead_mountp; #if REV_ENDIAN_FS #define MNT_REVEND 0x08000000 /* Reverse endian FS */ #endif /* REV_ENDIAN_FS */ -#define MNTK_FRCUNMOUNT 0x10000000 /* Forced unmount wanted. */ #define MNTK_AUTH_OPAQUE 0x20000000 /* authorisation decisions are not made locally */ #define MNTK_AUTH_OPAQUE_ACCESS 0x40000000 /* VNOP_ACCESS is reliable for remote auth */ #define MNTK_EXTENDED_SECURITY 0x80000000 /* extended security supported */ @@ -274,6 +273,7 @@ extern struct mount * dead_mountp; #define MNT_LWAIT 0x00000040 /* wait for unmount op */ #define MNT_LITERWAIT 0x00000080 /* mount in iteration */ #define MNT_LDEAD 0x00000100 /* mount already unmounted*/ +#define MNT_LNOSUB 0x00000200 /* submount - no recursion */ /* @@ -309,6 +309,7 @@ struct vfstable { int vfc_vfsflags; /* for optional types */ void * vfc_descptr; /* desc table allocated address */ int vfc_descsize; /* size allocated for desc table */ + struct sysctl_oid *vfc_sysctl; /* dynamically registered sysctl node */ }; /* vfc_vfsflags: */ @@ -319,18 +320,20 @@ struct vfstable { #define VFC_VFSPREFLIGHT 0x040 #define VFC_VFSREADDIR_EXTENDED 0x080 #define VFC_VFS64BITREADY 0x100 -#if CONFIG_VFS_FUNNEL -#define VFC_VFSTHREADSAFE 0x200 -#endif /* CONFIG_VFS_FUNNEL */ #define VFC_VFSNOMACLABEL 0x1000 #define VFC_VFSVNOP_PAGEINV2 0x2000 #define VFC_VFSVNOP_PAGEOUTV2 0x4000 +#define VFC_VFSVNOP_NOUPDATEID_RENAME 0x8000 +#if CONFIG_SECLUDED_RENAME +#define VFC_VFSVNOP_SECLUDE_RENAME 0x10000 +#endif -extern int maxvfsconf; /* highest defined filesystem type */ +extern int maxvfstypenum; /* highest defined filesystem type */ extern struct vfstable *vfsconf; /* head of list of filesystem types */ -extern int maxvfsslots; /* Maximum slots available to be used */ -extern int numused_vfsslots; /* number of slots already used */ +extern const int maxvfsslots; /* Maximum statically allocated slots available to be used */ +extern int numused_vfsslots; /* number of statically allocated slots already used */ +extern int numregistered_fses; /* number of total registered filesystems */ /* the following two are xnu private */ struct vfstable * vfstable_add(struct vfstable *); @@ -413,6 +416,7 @@ struct user32_statfs { __BEGIN_DECLS +extern boolean_t root_is_CF_drive; extern uint32_t mount_generation; extern TAILQ_HEAD(mntlist, mount) mountlist; void mount_list_lock(void); @@ -435,6 +439,7 @@ int vfs_mountroot(void); void vfs_unmountall(void); int safedounmount(struct mount *, int, vfs_context_t); int dounmount(struct mount *, int, int, vfs_context_t); +void dounmount_submounts(struct mount *, int, vfs_context_t); /* xnu internal api */ void mount_dropcrossref(mount_t, vnode_t, int); @@ -456,7 +461,7 @@ void mount_set_noreaddirext (mount_t); /* Private NFS spi */ #define KERNEL_MOUNT_NOAUTH 0x01 /* Don't check the UID of the directory we are mounting on */ #define KERNEL_MOUNT_PERMIT_UNMOUNT 0x02 /* Allow (non-forced) unmounts by users other the one who mounted the volume */ -#if NFSCLIENT +#if NFSCLIENT || DEVFS || ROUTEFS /* * NOTE: kernel_mount() does not force MNT_NOSUID, MNT_NOEXEC, or MNT_NODEC for non-privileged * mounting credentials, as the mount(2) system call does. @@ -466,15 +471,29 @@ boolean_t vfs_iskernelmount(mount_t); #endif /* throttled I/O api */ + +/* returned by throttle_io_will_be_throttled */ +#define THROTTLE_DISENGAGED 0 +#define THROTTLE_ENGAGED 1 +#define THROTTLE_NOW 2 + int throttle_get_io_policy(struct uthread **ut); +int throttle_get_passive_io_policy(struct uthread **ut); int throttle_io_will_be_throttled(int lowpri_window_msecs, mount_t mp); -void throttle_info_update_by_mount(mount_t mp); -void unthrottle_thread(uthread_t); +void *throttle_info_update_by_mount(mount_t mp); +void rethrottle_thread(uthread_t ut); +void throttle_info_reset_window(uthread_t ut); + /* throttled I/O helper function */ /* convert the lowest bit to a device index */ extern int num_trailing_0(uint64_t n); +/* sync lock */ +extern lck_mtx_t * sync_mtx_lck; + +extern int sync_timeout; + __END_DECLS #endif /* !_SYS_MOUNT_INTERNAL_H_ */