Changeset d8af1bd in mainline
- Timestamp:
- 2011-06-25T11:36:18Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 38b7233
- Parents:
- 53eb588
- Location:
- uspace/srv/fs/minixfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs.c
r53eb588 rd8af1bd 124 124 mfs_truncate(callid, &call); 125 125 break; 126 case VFS_OUT_DESTROY: 127 mfs_destroy(callid, &call); 128 break; 126 129 default: 127 130 async_answer_0(callid, ENOTSUP); -
uspace/srv/fs/minixfs/mfs.h
r53eb588 rd8af1bd 174 174 mfs_truncate(ipc_callid_t rid, ipc_call_t *request); 175 175 176 extern void 177 mfs_destroy(ipc_callid_t rid, ipc_call_t *request); 178 176 179 /*mfs_inode.c*/ 177 180 extern int -
uspace/srv/fs/minixfs/mfs_ops.c
r53eb588 rd8af1bd 57 57 static int mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name); 58 58 static int mfs_unlink(fs_node_t *, fs_node_t *, const char *name); 59 static int mfs_destroy_node(fs_node_t *fn); 59 60 60 61 static int mfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, … … 79 80 .link = mfs_link, 80 81 .unlink = mfs_unlink, 82 .destroy = mfs_destroy_node, 81 83 .plb_get_char = mfs_plb_get_char, 82 84 .has_children = mfs_has_children, … … 819 821 820 822 void 823 mfs_destroy(ipc_callid_t rid, ipc_call_t *request) 824 { 825 devmap_handle_t handle = (devmap_handle_t)IPC_GET_ARG1(*request); 826 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 827 fs_node_t *fn; 828 int r; 829 830 r = mfs_node_get(&fn, handle, index); 831 if (r != EOK) { 832 async_answer_0(rid, r); 833 return; 834 } 835 if (!fn) { 836 async_answer_0(rid, ENOENT); 837 return; 838 } 839 840 /*Destroy the inode*/ 841 r = mfs_destroy_node(fn); 842 async_answer_0(rid, r); 843 } 844 845 static int 846 mfs_destroy_node(fs_node_t *fn) 847 { 848 struct mfs_node *mnode = fn->data; 849 bool has_children; 850 int r; 851 852 r = mfs_has_children(&has_children, fn); 853 on_error(r, return r); 854 855 assert(!has_children); 856 857 /*Free the entire inode content*/ 858 r = inode_shrink(mnode, mnode->ino_i->i_size); 859 on_error(r, return r); 860 r = mfs_free_bit(mnode->instance, mnode->ino_i->index, BMAP_INODE); 861 on_error(r, return r); 862 863 free(mnode->ino_i); 864 free(mnode); 865 return r; 866 } 867 868 void 821 869 mfs_truncate(ipc_callid_t rid, ipc_call_t *request) 822 870 {
Note:
See TracChangeset
for help on using the changeset viewer.