Cleaning up f2fs's use of the symbol namespace
Hi, I was looking at f2fs's sources recently, and I noticed that there is a very large number of non-static symbols which don't have a f2fs prefix. There's well over a hundred (see attached below).
As one example, in fs/f2fs/dir.c there is:
unsigned char get_de_type(struct f2fs_dir_entry *de)
This function is clearly only useful for f2fs, but it has a generic name. This means that if any other file system tries to have the same symbol name, there will be a symbol conflict and the kernel would not successfully build. It also means that when someone is looking f2fs sources, it's not at all obvious whether a function such as read_data_page(), invalidate_blocks(), is a generic kernel function found in the fs, mm, or block layers, or a f2fs specific function.
You might want to fix this at some point. Hopefully Kent's bcachefs isn't similarly using genericly named functions, since that might cause conflicts with f2fs's functions --- but just as this would be a problem that we would rightly insist that Kent fix, this is something that we should have rightly insisted that f2fs should have fixed before it was integrated into the mainline kernel.
Cheers,
- Ted
acquire_orphan_inodeadd_ino_entryadd_orphan_inodeallocate_data_blockallocate_new_segmentsalloc_nidalloc_nid_donealloc_nid_failedavailable_free_memorybuild_free_nidsbuild_gc_managerbuild_node_managerbuild_segment_manager__check_rb_tree_consistenceclear_prefree_segmentscommit_inmem_pagescreate_checkpoint_cachescreate_extent_cachecreate_flush_cmd_controlcreate_node_manager_cachescreate_segment_manager_cachesdestroy_checkpoint_cachesdestroy_extent_cachedestroy_flush_cmd_controldestroy_node_managerdestroy_node_manager_cachesdestroy_segment_managerdestroy_segment_manager_cachesdo_make_empty_dirdo_write_data_pagedrop_discard_cmddrop_inmem_pagedrop_inmem_pagesdrop_inmem_pages_allexist_trim_candidatesexist_written_datafind_data_pagefind_in_inline_dirfind_target_dentryflush_nat_entriesflush_sit_entriesfsync_node_pagesget_de_typeget_dnode_of_dataget_lock_data_pageget_meta_pageget_new_data_pageget_next_page_offsetget_node_infoget_node_pageget_node_page_raget_read_data_pageget_sum_pageget_tmp_pageget_valid_checkpointgrab_meta_pagehandle_failed_inodeinit_discard_policyinit_extent_cache_infoinit_inode_metadatainit_ino_entry_infoinvalidate_blocksio_type_to_rw_hintis_checkpointed_datais_checkpointed_nodeis_dirty_deviceis_valid_blkaddrlookup_journal_in_cursum__lookup_rb_tree__lookup_rb_tree_for_insert__lookup_rb_tree_retmake_empty_inline_dirmove_node_pageneed_dentry_markneed_inode_block_updateneed_SSRnew_inode_pagenew_node_pagenpages_for_summary_flushra_meta_pagesra_meta_pages_condra_node_pageread_inline_datarecover_fsync_datarecover_inline_datarecover_inline_xattrrecover_inode_pagerecover_orphan_inodesrecover_xattr_dataregister_inmem_pagerelease_discard_addrsrelease_ino_entryrelease_orphan_inoderemove_dirty_inoderemove_inode_pageremove_ino_entryremove_orphan_inodereserve_new_blockreserve_new_blocksrestore_node_summaryrewrite_data_pageroom_for_filenamerw_hint_to_seg_typesanity_check_ckptset_data_blkaddrset_de_typeset_dirty_deviceshould_update_inplaceshould_update_outplacespace_for_roll_forwardstart_bidx_of_nodestart_gc_threadstop_discard_threadstop_gc_threadsync_dirty_inodessync_meta_pagessync_node_pagestruncate_blockstruncate_data_blockstruncate_data_blocks_rangetruncate_holetruncate_inline_inodetruncate_inode_blockstruncate_xattr_nodetry_to_free_natstry_to_free_nidsupdate_dirty_pageupdate_extension_listupdate_inodeupdate_inode_pageupdate_meta_pageupdate_parent_metadatawait_on_node_pages_writebackwrite_checkpointwrite_data_pagewrite_data_summarieswrite_meta_pagewrite_node_pagewrite_node_summaries
Hi Ted,
Quoted 16 lines · Theodore Y. Ts'o
Hi, I was looking at f2fs's sources recently, and I noticed that there is a very large number of non-static symbols which don't have a f2fs prefix. There's well over a hundred (see attached below).
As one example, in
fs/f2fs/dir.cthere is:unsigned char
get_de_type(struct f2fs_dir_entry *de)This function is clearly only useful for f2fs, but it has a generic name. This means that if any other file system tries to have the same symbol name, there will be a symbol conflict and the kernel would not successfully build. It also means that when someone is looking f2fs sources, it's not at all obvious whether a function such as
read_data_page(),invalidate_blocks(), is a generic kernel function found in the fs, mm, or block layers, or a f2fs specific function.
Quoted 6 lines
You might want to fix this at some point. Hopefully Kent's bcachefs isn't similarly using genericly named functions, since that might cause conflicts with f2fs's functions --- but just as this would be a problem that we would rightly insist that Kent fix, this is something that we should have rightly insisted that f2fs should have fixed before it was integrated into the mainline kernel.
Thanks for the report and suggestion, I think that makes sense to me. :)
To Jaegeuk, I wrote a patch for cleaning up exported symbols which have no 'f2fs_' prefix, could you please check it?
Thanks,
Quoted 156 lines
Cheers,
- Ted
acquire_orphan_inodeadd_ino_entryadd_orphan_inodeallocate_data_blockallocate_new_segmentsalloc_nidalloc_nid_donealloc_nid_failedavailable_free_memorybuild_free_nidsbuild_gc_managerbuild_node_managerbuild_segment_manager__check_rb_tree_consistenceclear_prefree_segmentscommit_inmem_pagescreate_checkpoint_cachescreate_extent_cachecreate_flush_cmd_controlcreate_node_manager_cachescreate_segment_manager_cachesdestroy_checkpoint_cachesdestroy_extent_cachedestroy_flush_cmd_controldestroy_node_managerdestroy_node_manager_cachesdestroy_segment_managerdestroy_segment_manager_cachesdo_make_empty_dirdo_write_data_pagedrop_discard_cmddrop_inmem_pagedrop_inmem_pagesdrop_inmem_pages_allexist_trim_candidatesexist_written_datafind_data_pagefind_in_inline_dirfind_target_dentryflush_nat_entriesflush_sit_entriesfsync_node_pagesget_de_typeget_dnode_of_dataget_lock_data_pageget_meta_pageget_new_data_pageget_next_page_offsetget_node_infoget_node_pageget_node_page_raget_read_data_pageget_sum_pageget_tmp_pageget_valid_checkpointgrab_meta_pagehandle_failed_inodeinit_discard_policyinit_extent_cache_infoinit_inode_metadatainit_ino_entry_infoinvalidate_blocksio_type_to_rw_hintis_checkpointed_datais_checkpointed_nodeis_dirty_deviceis_valid_blkaddrlookup_journal_in_cursum__lookup_rb_tree__lookup_rb_tree_for_insert__lookup_rb_tree_retmake_empty_inline_dirmove_node_pageneed_dentry_markneed_inode_block_updateneed_SSRnew_inode_pagenew_node_pagenpages_for_summary_flushra_meta_pagesra_meta_pages_condra_node_pageread_inline_datarecover_fsync_datarecover_inline_datarecover_inline_xattrrecover_inode_pagerecover_orphan_inodesrecover_xattr_dataregister_inmem_pagerelease_discard_addrsrelease_ino_entryrelease_orphan_inoderemove_dirty_inoderemove_inode_pageremove_ino_entryremove_orphan_inodereserve_new_blockreserve_new_blocksrestore_node_summaryrewrite_data_pageroom_for_filenamerw_hint_to_seg_typesanity_check_ckptset_data_blkaddrset_de_typeset_dirty_deviceshould_update_inplaceshould_update_outplacespace_for_roll_forwardstart_bidx_of_nodestart_gc_threadstop_discard_threadstop_gc_threadsync_dirty_inodessync_meta_pagessync_node_pagestruncate_blockstruncate_data_blockstruncate_data_blocks_rangetruncate_holetruncate_inline_inodetruncate_inode_blockstruncate_xattr_nodetry_to_free_natstry_to_free_nidsupdate_dirty_pageupdate_extension_listupdate_inodeupdate_inode_pageupdate_meta_pageupdate_parent_metadatawait_on_node_pages_writebackwrite_checkpointwrite_data_pagewrite_data_summarieswrite_meta_pagewrite_node_pagewrite_node_summaries------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel