In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you the "cephfs linux kernel client for fscache operation code", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "cephfs linux kernel client operation code for fscache" this article.
The operation of inode in fscache is mainly concentrated in the data structure struct fscache_cookie_def. The specific data structure and its operations are as follows:
Static const struct fscache_cookie_def ceph_fscache_inode_object_def = {
.name = "CEPH.inode"
.type = FSCACHE_COOKIE_TYPE_DATAFILE
.get _ key = ceph_fscache_inode_get_key
.get _ attr = ceph_fscache_inode_get_attr
.get _ aux = ceph_fscache_inode_get_aux
.check _ aux = ceph_fscache_inode_check_aux
.now _ uncached = ceph_fscache_inode_now_uncached
}
Ceph_fscache_inode_get_key (void * cookie_netfs_data, void * buffer, uint16_t maxbuf) reads i_vino information from struct ceph_inode_info to buffer
| | _ _ from parameter cookie_netfs_data to struct ceph_inode_info data structure |
| | _ _ call memcpy () to copy the i_vino content in struct ceph_inode_info to buffer |
Ceph_fscache_inode_get_attr (void * cookie_netfs_data, uint64_t * size) reads the size of vfs_inode in struct ceph_inode_info
| | _ _ from parameter cookie_netfs_data to struct ceph_inode_info data structure |
| | _ _ call the i_size_read () function to read the size of the vfs_inode in struct ceph_inode_info and save it to size |
Ceph_fscache_inode_get_aux (void * cookie_netfs_data, void * buffer, uint16_t bufmax)
| | _ _ from parameter cookie_netfs_data to struct ceph_inode_info data structure |
| | _ _ initialize struct ceph_aux_inode information |
| | _ _ initialize struct ceph_aux_inode information from struct ceph_inode_info structure |
| | _ _ copy struct ceph_aux_inode information to buffer |
Ceph_fscache_inode_check_aux (void * cookie_netfs_data, void * data, uint16_t dlen)
| | _ _ from parameter cookie_netfs_data to struct ceph_inode_info data structure |
| | _ _ initialize struct ceph_aux_inode information from struct ceph_inode_info structure |
| | _ _ compare the data and initialized struct ceph_aux_inode information in the parameters |
Ceph_fscache_inode_now_uncached (void * cookie_netfs_data)
| | _ _ from parameter cookie_netfs_data to struct ceph_inode_info data structure |
| | _ _ call pagevec_init () function to initialize pvec |
| | _ _ call the pagevec_lookup () function to find all mapped physical memory pages in struct ceph_inode_ infovfs _ inode.i_mapping |
| | _ _ call ClearPageFsCache () function to clear the fscache of the physical memory page |
| | _ _ call pagevec_release () function to release pvec |
Ceph_fscache_register_inode_cookie (struct inode * inode)
| | _ _ get struct ceph_inode_info and struct ceph_fs_client information from parameter inode |
| | _ _ call the fscache_acquire_cookie () function to get the cookie value of accessing ceph fscache and save the cookie value to the fscache of struct ceph_inode_info |
Ceph_fscache_unregister_inode_cookie (struct ceph_inode_info * ci)
| | _ _ call the fscache_uncache_all_inode_pages () function to delete all physical memory pages occupied by inode from cache |
| | _ _ call fscache_relinquish_cookie () function to delete cookie |
Ceph_fscache_can_enable (void * data)
| | _ _ get the struct inode data structure from the parameter data |
| | _ _ calls the inode_is_open_for_write (inode) function and returns the non-value returned by the function |
Ceph_fscache_file_set_cookie (struct inode * inode, struct file * filp)
| | _ _ get the struct ceph_inode_info data structure from the parameter inode |
| | _ _ call the fscache_cookie_valid () function to check whether the fscache in struct ceph_inode_info is valid, and return it directly if it is invalid |
| | _ _ call the inode_is_open_for_write () function to check whether inode is open and writable |
| | _ _ call fscache_disable_cookie () function to disable cookie |
| | _ _ call fscache_uncache_all_inode_pages () function to delete all physical memory pages of inode in cache |
| | _ _ call the inode_is_open_for_write () function to check whether inode is not open and not writable |
| | _ _ call fscache_enable_cookie () function to enable cookie |
Ceph_fscache_register ()
| | _ _ call the fscache_register_netfs () function to register the fscache of ceph |
Ceph_fscache_unregister ()
| | _ _ call the fscache_unregister_netfs () function to log out the fscache of ceph |
Ceph_fscache_register_fs (struct ceph_fs_client * fs)
| | _ _ call the fscache_acquire_cookie () function to get the cookie value of accessing ceph fscache and save the cookie value to the fscache of struct ceph_fs_client |
Ceph_fscache_unregister_fs (struct ceph_fs_client * fsc)
| | _ _ call fscache_relinquish_cookie () function to release fsc- > fscache data structure |
Ceph_fscache_session_get_key (void * cookie_netfs_data, void * buffer, uint16_t maxbuf)
| | _ _ from parameter cookie_netfs_data to struct ceph_fs_client data structure |
| | _ _ call the memcpy () function to copy the client- > FSID value in the struct ceph_fs_client data structure to buffer |
Ceph_readpage_from_fscache (struct inode * inode, struct page * page)
| | _ _ get the struct ceph_inode_info data structure from the parameter inode |
| | _ _ call the fscache_read_or_alloc_page () function to read the contents of inode from fscache and write them to page |
Ceph_readpages_from_fscache (struct inode * inode, struct address_space * mapping, struct list_head * pages, unsigned * nr_pages)
| | _ _ get the struct ceph_inode_info data structure from the parameter inode |
| | _ _ call the fscache_read_or_alloc_pages () function to read the data in mapping from fscahe and write it to pages |
Ceph_readpage_to_fscache (struct inode * inode, struct page * page)
| | _ _ get the struct ceph_inode_info data structure from the parameter inode |
| | _ _ call the fscache_write_page () function to synchronize the data from the physical memory page page to fscache |
Ceph_invalidate_fscache_page (struct inode * inode, struct page * page)
| | _ _ get the struct ceph_inode_info data structure from the parameter inode |
| | _ _ call the fscache_wait_on_page_write () function to wait for the page write to be completed |
| | _ _ call the fscache_uncache_page () function to delete the contents of page from the fscache in struct ceph_inode_info |
Ceph_fscache_revalidate_cookie (struct ceph_inode_info * ci)
| | _ _ call the cache_valid () function to check whether the fscache specified by ci is valid, if not |
| | _ _ call the fscache_check_consistency () function to verify the consistency of ci- > fscache, if not |
| | _ _ call fscache_invalidate () function to set ci- > fscache is invalid |
| | _ _ set ci- > iFeSCACHER genetics-> i_rdcache_gen |
The above is all the contents of this article "cephfs linux kernel client's operation code for fscache". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.