diff options
Diffstat (limited to 'kernel/fs/s5fs/s5fs_subr.c')
-rw-r--r-- | kernel/fs/s5fs/s5fs_subr.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/kernel/fs/s5fs/s5fs_subr.c b/kernel/fs/s5fs/s5fs_subr.c index 0187e74..33b03c9 100644 --- a/kernel/fs/s5fs/s5fs_subr.c +++ b/kernel/fs/s5fs/s5fs_subr.c @@ -91,7 +91,6 @@ static inline void s5_release_file_block(pframe_t **pfp) pframe_release(pfp); } -#ifdef OLD /* Given a file and a file block number, return the disk block number of the * desired file block. * @@ -100,6 +99,8 @@ static inline void s5_release_file_block(pframe_t **pfp) * the file * alloc - If set, allocate the block / indirect block as necessary * If clear, don't allocate sparse blocks + * newp - Return parameter that should be set to 1 if the returned + * block number is new (block has just been allocated) * * Return a disk block number on success, or: * - 0: The block is sparse, and alloc is clear, OR @@ -121,20 +122,13 @@ static inline void s5_release_file_block(pframe_t **pfp) * 1) file_blocknum < S_NDIRECT_BLOCKS * 2) Indirect block is not allocated but alloc is set. Be careful not to * leak a block in an error case! + 2a) Make sure you allocate the indirect block on disk and create a + corresponding pframe_t on the mobj (Hint: see s5_cache_and_clear_block). * 3) Indirect block is allocated. The desired block may be sparse, and you * may have to allocate it. * 4) The indirect block has not been allocated and alloc is clear. */ long s5_file_block_to_disk_block(s5_node_t *sn, size_t file_blocknum, - int alloc) -{ - NOT_YET_IMPLEMENTED("S5FS: s5_file_block_to_disk_block"); - return -1; -} -#endif - - -long s5_file_block_to_disk_block(s5_node_t *sn, size_t file_blocknum, int alloc, int *newp) { NOT_YET_IMPLEMENTED("S5FS: s5_file_block_to_disk_block"); @@ -211,7 +205,6 @@ ssize_t s5_write_file(s5_node_t *sn, size_t pos, const char *buf, size_t len) return -1; } -#ifdef OLD /* Allocate one block from the filesystem. * * Return the block number of the newly allocated block, or: @@ -243,13 +236,6 @@ static long s5_alloc_block(s5fs_t *s5fs) NOT_YET_IMPLEMENTED("S5FS: s5_alloc_block"); return -1; } -#endif - -static long s5_alloc_block(s5fs_t *s5fs) -{ - NOT_YET_IMPLEMENTED("S5FS: s5_alloc_block"); - return -1; -} /* * The exact opposite of s5_alloc_block: add blockno to the free list of the |