第二人生的源碼分析(四十四)虛擬檔案系統的請求處理

來源:互聯網
上載者:User

在虛擬檔案系統的訊息佇列裡,主要就是LLVFSThread::Request類的請求,Request類是嵌套類,定義在LLVFSThread類裡面。它主要實現對類LLVFS的封裝訪問,讓操作更加方便一些,當然它是繼續QueuedRequest類的,這樣才可以添加到訊息佇列裡去,否則不能添加到這個訊息佇列容器,也不能實現請求處理的多態了。
 
下面是類Request的建構函式。
#001 LLVFSThread::Request::Request(handle_t handle, U32 priority, U32 flags,
#002                                                  operation_t op, LLVFS* vfs,
#003                                                  const LLUUID &file_id, const LLAssetType::EType file_type,
#004                                                  U8* buffer, S32 offset, S32 numbytes) :
#005      QueuedRequest(handle, priority, flags),
#006      mOperation(op),
#007      mVFS(vfs),
#008      mFileID(file_id),
#009      mFileType(file_type),
#010      mBuffer(buffer),
#011      mOffset(offset),
#012      mBytes(numbytes),
#013      mBytesRead(0)
#014 {
#015      llassert(mBuffer);
#016 
 
判斷是否非法出錯。
#017      if (numbytes <= 0 && mOperation != FILE_RENAME)
#018 &n
<

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.