[CRIU] [PATCH] files-reg: Rework strip_deleted
Cyrill Gorcunov
gorcunov at gmail.com
Tue Jul 28 05:02:03 PDT 2015
On Tue, Jul 28, 2015 at 02:57:36PM +0300, Pavel Emelyanov wrote:
> >
> > That's the regular dcache code.
> >
> > char *dentry_path(struct dentry *dentry, char *buf, int buflen)
> > {
> > char *p = NULL;
> > char *retval;
> >
> > if (d_unlinked(dentry)) {
> > p = buf + buflen;
> > if (prepend(&p, &buflen, "//deleted", 10) != 0)
>
> O_O Some time ago it was only "(deleted)". When has it changed?
> Or the "(deleted)" also means something?
Nope, it has been here for years as far as I remember.
2.6.32
char *dentry_path(struct dentry *dentry, char *buf, int buflen)
{
char *end = buf + buflen;
char *retval;
spin_lock(&dcache_lock);
prepend(&end, &buflen, "\0", 1);
if (d_unlinked(dentry) &&
(prepend(&end, &buflen, "//deleted", 9) != 0))
goto Elong;
if (buflen < 1)
goto Elong;
/* Get '/' right */
retval = end-1;
*retval = '/';
As far as I remember, I introduced this helper and when I've
been making it I marked "hey, look for other postfixes some
day" somewhere in my mind. And managed to forget :)
More information about the CRIU
mailing list