*参照元 [#rf113fdc]
#backlinks

*説明 [#qea15f07]
-パス: [[linux-4.4.1/drivers/dma-buf/dma-buf.c]]

-FIXME: これは何?
--説明


**引数 [#o8d160fc]
-struct inode *inode
--
--[[linux-4.4.1/inode]]
-struct file *file
--
--[[linux-4.4.1/file]]


**返り値 [#cb12ae8b]
-int
--


**参考 [#s362638c]


*実装 [#a6884c2e]
 static int dma_buf_release(struct inode *inode, struct file *file)
 {
         struct dma_buf *dmabuf;
 
-
--[[linux-4.4.1/dma_buf]]

         if (!is_dma_buf_file(file))
                 return -EINVAL;
 
-
--[[linux-4.4.1/is_dma_buf_file()]]

         dmabuf = file->private_data;
 
         BUG_ON(dmabuf->vmapping_counter);
 
-
--[[linux-4.4.1/BUG_ON()]]

         /*
          * Any fences that a dma-buf poll can wait on should be signaled
          * before releasing dma-buf. This is the responsibility of each
          * driver that uses the reservation objects.
          *
          * If you hit this BUG() it means someone dropped their ref to the
          * dma-buf while still having pending operation to the buffer.
          */
         BUG_ON(dmabuf->cb_shared.active || dmabuf->cb_excl.active);
 
-
--dmabuf->cb_shared は struct dma_buf_poll_cb_t 型
--dmabuf->cb_excl は struct dma_buf_poll_cb_t 型
--[[linux-4.4.1/dma_buf_poll_cb_t]]

         dmabuf->ops->release(dmabuf);
 
-
--[[linux-4.4.1/]]
--dmabuf->ops は const struct dma_buf_ops * 型
--[[linux-4.4.1/dma_buf_ops]]

         mutex_lock(&db_list.lock);
         list_del(&dmabuf->list_node);
         mutex_unlock(&db_list.lock);
 
-
--[[linux-4.4.1/mutex_lock()]]
--[[linux-4.4.1/list_del()]]
--[[linux-4.4.1/mutex_unlock()]]
--[[linux-4.4.1/db_list(global)]]

         if (dmabuf->resv == (struct reservation_object *)&dmabuf[1])
                 reservation_object_fini(dmabuf->resv);
 
-
--[[linux-4.4.1/reservation_object()]]
--[[linux-4.4.1/reservation_object_fini()]]

         module_put(dmabuf->owner);
         kfree(dmabuf);
-
--[[linux-4.4.1/module_put()]]
--[[linux-4.4.1/kfree()]]

         return 0;
 }


*コメント [#i2393608]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS