| [2] | 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2007-2008, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bfile_buffered.h $ |
|---|
| 11 | * $brcm_Revision: 1 $ |
|---|
| 12 | * $brcm_Date: 9/18/08 3:25p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Block based cached file I/O |
|---|
| 17 | * |
|---|
| 18 | * Revision History: |
|---|
| 19 | * |
|---|
| 20 | * $brcm_Log: /BSEAV/lib/bfile/bfile_buffered.h $ |
|---|
| 21 | * |
|---|
| 22 | * 1 9/18/08 3:25p vsilyaev |
|---|
| 23 | * PR 47105: Layered buffer cache that provides cached interface for any |
|---|
| 24 | * file descriptor |
|---|
| 25 | * |
|---|
| 26 | * 2 6/14/07 12:49p vsilyaev |
|---|
| 27 | * PR 32162: Serializes async disk I/O for bfile_buffered. Fixed unitilized |
|---|
| 28 | * ref_cnt in bfile_buffered.c |
|---|
| 29 | * |
|---|
| 30 | * 1 5/16/07 9:53p vsilyaev |
|---|
| 31 | * PR 28631: Added block based file cache/buffered |
|---|
| 32 | * |
|---|
| 33 | *******************************************************************************/ |
|---|
| 34 | #ifndef _BFILE_BUFFERED_H__ |
|---|
| 35 | #define _BFILE_BUFFERED_H__ |
|---|
| 36 | |
|---|
| 37 | #include "bfile_io.h" |
|---|
| 38 | #include "bioatom.h" |
|---|
| 39 | #include "bfile_buffer.h" |
|---|
| 40 | |
|---|
| 41 | #ifdef __cplusplus |
|---|
| 42 | extern "C" |
|---|
| 43 | { |
|---|
| 44 | #endif |
|---|
| 45 | |
|---|
| 46 | typedef struct bfile_buffered *bfile_buffered_t; |
|---|
| 47 | |
|---|
| 48 | typedef struct bfile_buffered_cfg { |
|---|
| 49 | unsigned nsegs; |
|---|
| 50 | size_t buf_len; |
|---|
| 51 | } bfile_buffered_cfg; |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | void bfile_buffered_default_cfg(bfile_buffered_cfg *cfg); |
|---|
| 55 | bfile_buffered_t bfile_buffered_create(batom_factory_t factory, bfile_buffered_cfg *cfg); |
|---|
| 56 | void bfile_buffered_destroy(bfile_buffered_t file); |
|---|
| 57 | bfile_io_read_t bfile_buffered_attach(bfile_buffered_t file, bfile_io_read_t fd); |
|---|
| 58 | bfile_buffer_t bfile_buffered_get_buffer(bfile_buffered_t file); |
|---|
| 59 | void bfile_buffered_detach(bfile_buffered_t file); |
|---|
| 60 | |
|---|
| 61 | #ifdef __cplusplus |
|---|
| 62 | } |
|---|
| 63 | #endif |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | #endif /* _BFILE_BUFFERED_H__ */ |
|---|
| 67 | |
|---|
| 68 | |
|---|