lkml.org 
[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectMaking linkat() able to overwrite the target
Date
With my rewrite of fscache and cachefiles:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=fscache-iter

when a file gets invalidated by the server - and, under some circumstances,
modified locally - I have the cache create a temporary file with vfs_tmpfile()
that I'd like to just link into place over the old one - but I can't because
vfs_link() doesn't allow you to do that. Instead I have to either unlink the
old one and then link the new one in or create it elsewhere and rename across.

Would it be possible to make linkat() take a flag, say AT_LINK_REPLACE, that
causes the target to be replaced and not give EEXIST? Or make it so that
rename() can take a tmpfile as the source and replace the target with that. I
presume that, either way, this would require journal changes on ext4, xfs and
btrfs.

Thanks,
David

\
 
 \ /
  Last update: 2020-01-14 17:35    [W:0.084 / U:19.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site