X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=fs%2Fdcache.c;h=da89cdfb21ab8ab90905b8fc811cf62abd355678;hb=acb2e930c72a1d38504d6d9c1f338562bbb9aa55;hp=f09b9085f7d849e235a2b8d77c079de71c96f5d2;hpb=3e11a00d8561622a2598254853e2e8cc3e51e544;p=firefly-linux-kernel-4.4.55.git diff --git a/fs/dcache.c b/fs/dcache.c index f09b9085f7d8..da89cdfb21ab 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2724,6 +2724,17 @@ char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen, return memcpy(buffer, temp, sz); } +char *simple_dname(struct dentry *dentry, char *buffer, int buflen) +{ + char *end = buffer + buflen; + /* these dentries are never renamed, so d_lock is not needed */ + if (prepend(&end, &buflen, " (deleted)", 11) || + prepend_name(&end, &buflen, &dentry->d_name) || + prepend(&end, &buflen, "/", 1)) + end = ERR_PTR(-ENAMETOOLONG); + return end; +} + /* * Write full pathname from the root of the filesystem into the buffer. */