All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Gabriel Krisman Bertazi <krisman@suse.de>,
	Tony Solomonik <tony.solomonik@gmail.com>
Cc: asml.silence@gmail.com, io-uring@vger.kernel.org
Subject: Re: [PATCH 1/2] io_uring: add support for truncate
Date: Mon, 22 Jan 2024 13:22:41 -0700	[thread overview]
Message-ID: <ea2ce488-779c-4ad1-82f0-285fb2cfddcc@kernel.dk> (raw)
In-Reply-To: <875xzlw2iv.fsf@mailhost.krisman.be>

On 1/22/24 1:12 PM, Gabriel Krisman Bertazi wrote:
> Tony Solomonik <tony.solomonik@gmail.com> writes:
> 
>> Libraries that are built on io_uring currently need to maintain a
>> separate thread pool implementation when they want to truncate a file.
> 
> I don't think it makes sense to have both ftruncate and truncate in
> io_uring.  One can just as easily link an open+ftruncate to have the
> same semantics in one go.

Yeah, see comment on the life time issue with this one as well, which
is avoided with the fd variant. So if just having the ftruncate variant
is good enough, that's solve that headache too. And if done like I
suggested where fd must be valid and we -EINVAL on sqe->addr being
set, you could always add truncate by path functionality later on top
without requiring a new opcode just for that.

-- 
Jens Axboe



  reply	other threads:[~2024-01-22 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 19:37 [PATCH 1/2] io_uring: add support for truncate Tony Solomonik
2024-01-22 19:37 ` [PATCH 2/2] io_uring: add support for ftruncate Tony Solomonik
2024-01-22 20:12   ` Jens Axboe
2024-01-22 19:56 ` [PATCH 1/2] io_uring: add support for truncate Breno Leitao
2024-01-22 20:10 ` Jens Axboe
2024-01-22 20:12 ` Gabriel Krisman Bertazi
2024-01-22 20:22   ` Jens Axboe [this message]
2024-01-22 20:21 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea2ce488-779c-4ad1-82f0-285fb2cfddcc@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=krisman@suse.de \
    --cc=tony.solomonik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.