Changeset de5b708 in mainline for uspace/lib/ext4/src/ops.c
- Timestamp:
- 2017-05-12T17:15:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 395df52
- Parents:
- be39fc6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/src/ops.c
rbe39fc6 rde5b708 928 928 fs_index_t *index, aoff64_t *size, unsigned *lnkcnt) 929 929 { 930 /* Allocate libext4 filesystem structure */ 931 ext4_filesystem_t *fs = (ext4_filesystem_t *) 932 malloc(sizeof(ext4_filesystem_t)); 933 if (fs == NULL) 934 return ENOMEM; 930 ext4_filesystem_t *fs; 935 931 936 932 /* Allocate instance structure */ 937 933 ext4_instance_t *inst = (ext4_instance_t *) 938 934 malloc(sizeof(ext4_instance_t)); 939 if (inst == NULL) { 940 free(fs); 935 if (inst == NULL) 941 936 return ENOMEM; 942 }943 937 944 938 enum cache_mode cmode; … … 951 945 link_initialize(&inst->link); 952 946 inst->service_id = service_id; 953 inst->filesystem = fs;954 947 inst->open_nodes_count = 0; 955 948 956 949 /* Initialize the filesystem */ 957 950 aoff64_t rnsize; 958 int rc = ext4_filesystem_init(fs, inst, service_id, cmode, &rnsize); 959 if (rc != EOK) { 960 free(fs); 951 int rc = ext4_filesystem_open(inst, service_id, cmode, &rnsize, &fs); 952 if (rc != EOK) { 961 953 free(inst); 962 954 return rc; … … 1005 997 fibril_mutex_unlock(&open_nodes_lock); 1006 998 1007 return ext4_filesystem_fini(inst->filesystem); 999 rc = ext4_filesystem_close(inst->filesystem); 1000 if (rc != EOK) { 1001 fibril_mutex_lock(&instance_list_mutex); 1002 list_append(&inst->link, &instance_list); 1003 fibril_mutex_unlock(&instance_list_mutex); 1004 } 1005 1006 free(inst); 1007 return EOK; 1008 1008 } 1009 1009
Note:
See TracChangeset
for help on using the changeset viewer.