ffs_softdep.c (141533) | ffs_softdep.c (141539) |
---|---|
1/*- 2 * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. 3 * 4 * The soft updates code is derived from the appendix of a University 5 * of Michigan technical report (Gregory R. Ganger and Yale N. Patt, 6 * "Soft Updates: A Solution to the Metadata Update Problem in File 7 * Systems", CSE-TR-254-95, August 1995). 8 * --- 25 unchanged lines hidden (view full) --- 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 39 */ 40 41#include <sys/cdefs.h> | 1/*- 2 * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. 3 * 4 * The soft updates code is derived from the appendix of a University 5 * of Michigan technical report (Gregory R. Ganger and Yale N. Patt, 6 * "Soft Updates: A Solution to the Metadata Update Problem in File 7 * Systems", CSE-TR-254-95, August 1995). 8 * --- 25 unchanged lines hidden (view full) --- 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 39 */ 40 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_softdep.c 141533 2005-02-08 18:09:11Z phk $"); | 42__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_softdep.c 141539 2005-02-08 20:29:10Z phk $"); |
43 44/* 45 * For now we want the safety net that the DIAGNOSTIC and DEBUG flags provide. 46 */ 47#ifndef DIAGNOSTIC 48#define DIAGNOSTIC 49#endif 50#ifndef DEBUG --- 166 unchanged lines hidden (view full) --- 217static void add_to_worklist(struct worklist *); 218 219/* 220 * Exported softdep operations. 221 */ 222static void softdep_disk_io_initiation(struct buf *); 223static void softdep_disk_write_complete(struct buf *); 224static void softdep_deallocate_dependencies(struct buf *); | 43 44/* 45 * For now we want the safety net that the DIAGNOSTIC and DEBUG flags provide. 46 */ 47#ifndef DIAGNOSTIC 48#define DIAGNOSTIC 49#endif 50#ifndef DEBUG --- 166 unchanged lines hidden (view full) --- 217static void add_to_worklist(struct worklist *); 218 219/* 220 * Exported softdep operations. 221 */ 222static void softdep_disk_io_initiation(struct buf *); 223static void softdep_disk_write_complete(struct buf *); 224static void softdep_deallocate_dependencies(struct buf *); |
225static void softdep_move_dependencies(struct buf *, struct buf *); | |
226static int softdep_count_dependencies(struct buf *bp, int); 227 228static struct mtx lk; 229MTX_SYSINIT(softdep_lock, &lk, "Softdep Lock", MTX_DEF); 230 231#define ACQUIRE_LOCK(lk) mtx_lock(lk) 232#define FREE_LOCK(lk) mtx_unlock(lk) 233 --- 358 unchanged lines hidden (view full) --- 592 } 593 ACQUIRE_LOCK(&lk); 594 return (matchcnt); 595} 596 597/* 598 * Move dependencies from one buffer to another. 599 */ | 225static int softdep_count_dependencies(struct buf *bp, int); 226 227static struct mtx lk; 228MTX_SYSINIT(softdep_lock, &lk, "Softdep Lock", MTX_DEF); 229 230#define ACQUIRE_LOCK(lk) mtx_lock(lk) 231#define FREE_LOCK(lk) mtx_unlock(lk) 232 --- 358 unchanged lines hidden (view full) --- 591 } 592 ACQUIRE_LOCK(&lk); 593 return (matchcnt); 594} 595 596/* 597 * Move dependencies from one buffer to another. 598 */ |
600static void | 599void |
601softdep_move_dependencies(oldbp, newbp) 602 struct buf *oldbp; 603 struct buf *newbp; 604{ 605 struct worklist *wk, *wktail; 606 607 if (LIST_FIRST(&newbp->b_dep) != NULL) 608 panic("softdep_move_dependencies: need merge code"); --- 378 unchanged lines hidden (view full) --- 987 988 /* hooks through which the main kernel code calls us */ 989 softdep_process_worklist_hook = softdep_process_worklist; 990 991 /* initialise bioops hack */ 992 bioops.io_start = softdep_disk_io_initiation; 993 bioops.io_complete = softdep_disk_write_complete; 994 bioops.io_deallocate = softdep_deallocate_dependencies; | 600softdep_move_dependencies(oldbp, newbp) 601 struct buf *oldbp; 602 struct buf *newbp; 603{ 604 struct worklist *wk, *wktail; 605 606 if (LIST_FIRST(&newbp->b_dep) != NULL) 607 panic("softdep_move_dependencies: need merge code"); --- 378 unchanged lines hidden (view full) --- 986 987 /* hooks through which the main kernel code calls us */ 988 softdep_process_worklist_hook = softdep_process_worklist; 989 990 /* initialise bioops hack */ 991 bioops.io_start = softdep_disk_io_initiation; 992 bioops.io_complete = softdep_disk_write_complete; 993 bioops.io_deallocate = softdep_deallocate_dependencies; |
995 bioops.io_movedeps = softdep_move_dependencies; | |
996 bioops.io_countdeps = softdep_count_dependencies; 997} 998 999/* 1000 * Executed after all filesystems have been unmounted during 1001 * filesystem module unload. 1002 */ 1003void --- 4649 unchanged lines hidden --- | 994 bioops.io_countdeps = softdep_count_dependencies; 995} 996 997/* 998 * Executed after all filesystems have been unmounted during 999 * filesystem module unload. 1000 */ 1001void --- 4649 unchanged lines hidden --- |