From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9715E26FDBF for ; Fri, 12 Dec 2025 01:02:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765501324; cv=none; b=i7QVbhWdxGo9h9HmP3yHj3j3TWEfVYp5RXH0EOFAtDtzT53XD4xe5JGmdOPcrZYHxzKQniDoM4uLYaY6w5yYSfYZKJB/5MygpdXnuCvpAyyhdFeGb0gMG2e7rYV7ichG8+PPGwC4s5inMNJahCElKYWyU4C7Mg88l7jVoe2Xr5M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765501324; c=relaxed/simple; bh=yjTz9N1XnY76DvE5bcGPlvLqbXen/pl4og5ZynCkays=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AYTz46brIa4AO6HGLPqXrvgaG8J+aFpsECQyzsGDUmuGV6XefoJDCOMjaTQT4NZXDzu2axmNmDk7CwNMRASAB9+qq8xTk7TDl2X2BCq/mPy426BST4kJ65xZS95DuWNmUzZOJ+dvKS/VtKR8TRioVqQX6Unqa6zV3K2YT3yCsMA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mIe0zEWO; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mIe0zEWO" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7b22ffa2a88so714064b3a.1 for ; Thu, 11 Dec 2025 17:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765501320; x=1766106120; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PiqT1y0DQKTCKplE+X4RtztJVQKRqPD52kbRIZIB4Kc=; b=mIe0zEWOhKI4U9y7ZGHmoHnn9HlPYwG1u3dzSpG27lFusenPgMQaop0WsHh82S9K32 ibTUsc7Tqo0HBmmHetIvsFh8C4moGVobhEDzFgXL+e+qJ7UGnCaHPQQkZw3NHSZGeKOt OdqkbWC4mq3AMmTu+1ZmEutP3AWH1qYgGOGhS/gcEc+RGtMbDegyLHkZbq5GGcsCNI6d Q+DUai5SxF5/eKeIGhwbRZlFy0M1YFSYBIGEdvDbQogDgD+qbQEvlJRcNnzUDezwAdc7 1le/zBt2FNQey8IoPMHjkRXwEkgjmY2tpMppumGngsaHpEqwxU5yKjE/EPdOYqO0Wt4e icbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765501320; x=1766106120; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PiqT1y0DQKTCKplE+X4RtztJVQKRqPD52kbRIZIB4Kc=; b=V5R8qxhxWbf2HhYk8P+LFm+aei9eyUmj5GwT4BXilaLxVc2sGtuUtEUU+2U5QXJC3B 6Pj1om5Bntd1xAHVt6wbJHVki/D3sHR9OuOnfDqly3ZceoLpjt/HJ18oFmCvtjF8WLuB 4XI/Z8AZqfoCyomnN2Pm/D33CGr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SaBrc+e6H5PWtVLyiGmX8KUNYIA== X-Received: by 2002:a05:6a20:1584:b0:35d:7f7:4aac with SMTP id adf61e73a8af0-369afa01e9emr370191637.47.1765501320420; Thu, 11 Dec 2025 17:02:00 -0800 (PST) Received: from [10.200.8.97] (fs98a57d9c.tkyc007.ap.nuro.jp. [152.165.125.156]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c0c2b9d8a2bsm3358325a12.27.2025.12.11.17.01.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Dec 2025 17:01:59 -0800 (PST) Message-ID: Date: Fri, 12 Dec 2025 01:02:04 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC v2 01/11] file: add callback for pre-mapping dmabuf To: Christoph Hellwig Cc: linux-block@vger.kernel.org, io-uring@vger.kernel.org, Vishal Verma , tushar.gohad@intel.com, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Alexander Viro , Christian Brauner , Andrew Morton , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org References: <74d689540fa200fe37f1a930165357a92fe9e68c.1763725387.git.asml.silence@gmail.com> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/4/25 10:42, Christoph Hellwig wrote: > On Sun, Nov 23, 2025 at 10:51:21PM +0000, Pavel Begunkov wrote: >> +static inline struct dma_token * >> +dma_token_create(struct file *file, struct dma_token_params *params) >> +{ >> + struct dma_token *res; >> + >> + if (!file->f_op->dma_map) >> + return ERR_PTR(-EOPNOTSUPP); >> + res = file->f_op->dma_map(file, params); > > Calling the file operation ->dmap_map feels really misleading. agreed > create_token as in the function name is already much better, but > it really is not just dma, but dmabuf related, and that should really > be encoded in the name. > > Also why not pass the dmabuf and direction directly instead of wrapping > it in the odd params struct making the whole thing hard to follow? I added it after I forgot about the direction and had to plumb it through all the layers. In a draft of v3 I had I already removed it as dmabuf is passed with the token to drivers. -- Pavel Begunkov