void filemap_release(struct file *file) { assert(file->status == FD_OPENED || file->status == FD_CLOSED); assert(fopen_count(file) > 0); if (fopen_count_dec(file) == 0) { filemap_free(file); } }
// fd_array_close - file's open_count--; if file's open_count-- == 0 , then call fd_array_free to free this file item void fd_array_close(struct file *file) { assert(file->status == FD_OPENED); assert(fopen_count(file) > 0); file->status = FD_CLOSED; if (fopen_count_dec(file) == 0) { fd_array_free(file); } }
void filemap_release(struct file *file) { assert(fopen_count(file) > 0); fopen_count_dec(file); }