X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..bb59bff194111743b33cc36712410b5656329d3c:/bsd/sys/buf.h diff --git a/bsd/sys/buf.h b/bsd/sys/buf.h index 93c885982..6db9a6937 100644 --- a/bsd/sys/buf.h +++ b/bsd/sys/buf.h @@ -275,7 +275,7 @@ void buf_seterror(buf_t, errno_t); /*! @function buf_setflags @abstract Set flags on a buffer. - @discussion: buffer_flags |= flags + @discussion buffer_flags |= flags @param bp Buffer whose flags to set. @param flags Flags to add to buffer's mask. B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA @return void. @@ -285,7 +285,7 @@ void buf_setflags(buf_t, int32_t); /*! @function buf_clearflags @abstract Clear flags on a buffer. - @discussion: buffer_flags &= ~flags + @discussion buffer_flags &= ~flags @param bp Buffer whose flags to clear. @param flags Flags to remove from buffer's mask. B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA @return void. @@ -1002,7 +1002,7 @@ buf_t buf_geteblk(int); /*! @function buf_clear_redundancy_flags @abstract Clear flags on a buffer. - @discussion: buffer_redundancy_flags &= ~flags + @discussion buffer_redundancy_flags &= ~flags @param bp Buffer whose flags to clear. @param flags Flags to remove from buffer's mask @return void. @@ -1020,7 +1020,7 @@ uint32_t buf_redundancy_flags(buf_t); /*! @function buf_setredundancyflags @abstract Set redundancy flags on a buffer. - @discussion: buffer_redundancy_flags |= flags + @discussion buffer_redundancy_flags |= flags @param bp Buffer whose flags to set. @param flags Flags to add to buffer's redundancy flags @return void. @@ -1054,8 +1054,9 @@ int buf_static(buf_t); #ifdef KERNEL_PRIVATE void buf_setfilter(buf_t, void (*)(buf_t, void *), void *, void (**)(buf_t, void *), void **); +/* bufattr allocation/duplication/deallocation functions */ bufattr_t bufattr_alloc(void); - +bufattr_t bufattr_dup (bufattr_t bap); void bufattr_free(bufattr_t bap); /*! @@ -1104,7 +1105,7 @@ int bufattr_rawencrypted(bufattr_t bap); @function bufattr_markgreedymode @abstract Mark a buffer to use the greedy mode for writing. @param bap Buffer attributes to mark. - @discussion Greedy Mode: request improved write performance from the underlying device at the expense of storage effeciency + @discussion Greedy Mode: request improved write performance from the underlying device at the expense of storage efficiency @return void. */ void bufattr_markgreedymode(bufattr_t bap); @@ -1113,11 +1114,30 @@ int bufattr_rawencrypted(bufattr_t bap); @function bufattr_greedymode @abstract Check if a buffer is written using the Greedy Mode @param bap Buffer attributes to test. - @discussion Greedy Mode: request improved write performance from the underlying device at the expense of storage effeciency + @discussion Greedy Mode: request improved write performance from the underlying device at the expense of storage efficiency @return Nonzero if buffer uses greedy mode, 0 otherwise. */ int bufattr_greedymode(bufattr_t bap); +/*! + @function bufattr_markisochronous + @abstract Mark a buffer to use the isochronous throughput mode for writing. + @param bap Buffer attributes to mark. + @discussion isochronous mode: request improved write performance from the underlying device at the expense of storage efficiency + @return void. + */ + void bufattr_markisochronous(bufattr_t bap); + + /*! + @function bufattr_isochronous + @abstract Check if a buffer is written using the isochronous + @param bap Buffer attributes to test. + @discussion isochronous mode: request improved write performance from the underlying device at the expense of storage efficiency + @return Nonzero if buffer uses isochronous mode, 0 otherwise. + */ +int bufattr_isochronous(bufattr_t bap); + + /*! @function bufattr_throttled @abstract Check if a buffer is throttled. @@ -1126,6 +1146,14 @@ int bufattr_greedymode(bufattr_t bap); */ int bufattr_throttled(bufattr_t bap); +/*! + @function bufattr_passive + @abstract Check if a buffer is marked passive. + @param bap Buffer attribute to test. + @return Nonzero if the buffer is marked passive, 0 otherwise. + */ +int bufattr_passive(bufattr_t bap); + /*! @function bufattr_nocache @abstract Check if a buffer has nocache attribute. @@ -1136,13 +1164,22 @@ int bufattr_nocache(bufattr_t bap); /*! @function bufattr_meta - @abstract Check if a buffer has meta attribute. + @abstract Check if a buffer has the bufattr meta attribute. @param bap Buffer attribute to test. @return Nonzero if the buffer has meta attribute, 0 otherwise. */ int bufattr_meta(bufattr_t bap); +/*! + @function bufattr_markmeta + @abstract Set the bufattr meta attribute. + @param bap Buffer attribute to manipulate. + @return void + */ +void bufattr_markmeta(bufattr_t bap); + + /*! @function bufattr_delayidlesleep @abstract Check if a buffer is marked to delay idle sleep on disk IO.