参照元

説明

引数

返り値

参考

実装

static int dma_buf_release(struct inode *inode, struct file *file)
{
        struct dma_buf *dmabuf;
        if (!is_dma_buf_file(file))
                return -EINVAL;
        dmabuf = file->private_data;

        BUG_ON(dmabuf->vmapping_counter);
        /*
         * 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->ops->release(dmabuf);
        mutex_lock(&db_list.lock);
        list_del(&dmabuf->list_node);
        mutex_unlock(&db_list.lock);
        if (dmabuf->resv == (struct reservation_object *)&dmabuf[1])
                reservation_object_fini(dmabuf->resv);
        module_put(dmabuf->owner);
        kfree(dmabuf);
        return 0;
}

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS