www.pudn.com > efs.rar > fs_factory.h


/*********************************************************************** 
 * fs_factory.h 
 * 
 * Factory image construction/deconstruction. 
 * Copyright (C) 2004, 2005, 2006 QUALCOMM, Inc. 
 * 
 * This module is responsible for both the construction and deconstruction 
 * of a canonicalized EFS factory image.  The factory image is a compact 
 * representation that can be placed in a fresh flash device (occupying 
 * consecutive good blocks).  Upon startup, this code is then able to 
 * reconstruct a live filesystem from the image. 
 * 
 ***********************************************************************/ 
 
/*=========================================================================== 
 
                        EDIT HISTORY FOR MODULE 
 
  This section contains comments describing changes made to the module. 
  Notice that changes are listed in reverse chronological order. 
 
  $Header: //depot/asic/MSMSHARED/services/efs/MSM_EFS.01.02/fs_factory.h#2 $ $DateTime: 2006/03/24 15:39:56 $ $Author: davidb $ 
 
when         who   what, where, why 
----------   ---   --------------------------------------------------------- 
2006-03-09   dlb   Add a few function exports for testing. 
2005-01-04   dlb   Update copyright line. 
2004-12-14   dlb   Create 
 
===========================================================================*/ 
 
#ifndef __FS_FACTORY_H__ 
#define __FS_FACTORY_H__ 
 
#include "fs_sys_types.h" 
#include "fs_buffer.h" 
 
/* Read the next chunk of the factory image data.  Uses the fields in the 
 * read_info structure to keep track of state (this structure is sent back 
 * and forth with the protocol).  The specific fields are historical, 
 * because they were incorporated into a protocol. 
 * 
 * Returns 0 on success, or a negative errno value to indicate an error. 
 * Normal completion is indicated by a return with the 
 * info->stream_state==0.  Note that when the end is indicated this way, a 
 * bogus page of data is also returned.  This page should not be included 
 * in the image. 
 * 
 * The assumption is made that the filesystem is locked for the entire 
 * duration of the image transfer.  Changes to the filesystem between calls 
 * to fs_fact_get_chunk will almost certainly result in a corrupted 
 * filesystem in the target system. 
 */ 
int fs_fact_get_chunk (struct fs_factimage_read_info *info, 
    byte *page_data, 
    struct fsb_nand_data *buf); 
 
/* This function is called on startup to check for the presence of a 
 * factory image, and if detected, reconstruct the necessary tables, and 
 * superblocks.  It should return the offset of the constructed superblock, 
 * which will allow the ordinary startup code to proceed. */ 
int fs_fact_startup_check (fs_super_t super, fs_device_t dev); 
 
#ifdef FS_UNIT_TEST 
#error code not present 
#endif 
 
#endif /* not __FS_FACTORY_H__ */