Changeset 0b293a6 in mainline


Ignore:
Timestamp:
2012-07-21T08:58:29Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7deca26
Parents:
fe61181
Message:

added variable cache mode + missing cache fini

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_filesystem.c

    rfe61181 r0b293a6  
    4747 * @return                                      error code
    4848 */
    49 int ext4_filesystem_init(ext4_filesystem_t *fs, service_id_t service_id)
     49int ext4_filesystem_init(ext4_filesystem_t *fs, service_id_t service_id,
     50                enum cache_mode cmode)
    5051{
    5152        int rc;
     
    7576
    7677        /* Initialize block caching by libblock */
    77         rc = block_cache_init(service_id, block_size, 0, CACHE_MODE_WB);
     78        rc = block_cache_init(service_id, block_size, 0, cmode);
    7879        if (rc != EOK) {
    7980                block_fini(fs->device);
     
    136137
    137138        /* Finish work with block library */
     139        block_cache_fini(fs->device);
    138140        block_fini(fs->device);
    139141
     
    878880        inode_ref->dirty = true;
    879881
     882        /* Free block with extended attributes if present */
     883        uint32_t xattr_block = ext4_inode_get_file_acl(
     884                        inode_ref->inode, fs->superblock);
     885        if (xattr_block) {
     886                rc = ext4_balloc_free_block(inode_ref, xattr_block);
     887                if (rc != EOK) {
     888                        return rc;
     889                }
     890
     891                ext4_inode_set_file_acl(inode_ref->inode, fs->superblock, 0);
     892        }
     893
    880894        /* Free inode by allocator */
    881895        if (ext4_inode_is_type(fs->superblock, inode_ref->inode,
  • uspace/lib/ext4/libext4_filesystem.h

    rfe61181 r0b293a6  
    3737#include "libext4_types.h"
    3838
    39 extern int ext4_filesystem_init(ext4_filesystem_t *, service_id_t);
     39extern int ext4_filesystem_init(ext4_filesystem_t *,
     40                service_id_t, enum cache_mode);
    4041extern int ext4_filesystem_fini(ext4_filesystem_t *fs);
    4142extern int ext4_filesystem_check_sanity(ext4_filesystem_t *fs);
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    rfe61181 r0b293a6  
    910910        }
    911911
     912        enum cache_mode cmode;
     913        if (str_cmp(opts, "wtcache") == 0) {
     914                cmode = CACHE_MODE_WT;
     915        } else {
     916                cmode = CACHE_MODE_WB;
     917        }
     918
    912919        /* Initialize the filesystem */
    913         rc = ext4_filesystem_init(fs, service_id);
     920        rc = ext4_filesystem_init(fs, service_id, cmode);
    914921        if (rc != EOK) {
    915922                free(fs);
Note: See TracChangeset for help on using the changeset viewer.