]> Pileus Git - ~andy/linux/blobdiff - fs/dcache.c
cope with potentially long ->d_dname() output for shmem/hugetlb
[~andy/linux] / fs / dcache.c
index 87bdb5329c3c90b99d67f4b5bab3ae0b347d2acf..83cfb834db0364b1ffed30d58815f826aaaf55dd 100644 (file)
@@ -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.
  */