aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index ebafde7d6aba..3a89592bdf57 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -841,8 +841,18 @@ static int pipefs_delete_dentry(struct dentry *dentry)
841 return 0; 841 return 0;
842} 842}
843 843
844/*
845 * pipefs_dname() is called from d_path().
846 */
847static char *pipefs_dname(struct dentry *dentry, char *buffer, int buflen)
848{
849 return dynamic_dname(dentry, buffer, buflen, "pipe:[%lu]",
850 dentry->d_inode->i_ino);
851}
852
844static struct dentry_operations pipefs_dentry_operations = { 853static struct dentry_operations pipefs_dentry_operations = {
845 .d_delete = pipefs_delete_dentry, 854 .d_delete = pipefs_delete_dentry,
855 .d_dname = pipefs_dname,
846}; 856};
847 857
848static struct inode * get_pipe_inode(void) 858static struct inode * get_pipe_inode(void)
@@ -888,8 +898,7 @@ struct file *create_write_pipe(void)
888 struct inode *inode; 898 struct inode *inode;
889 struct file *f; 899 struct file *f;
890 struct dentry *dentry; 900 struct dentry *dentry;
891 char name[32]; 901 struct qstr name = { .name = "" };
892 struct qstr this;
893 902
894 f = get_empty_filp(); 903 f = get_empty_filp();
895 if (!f) 904 if (!f)
@@ -899,11 +908,8 @@ struct file *create_write_pipe(void)
899 if (!inode) 908 if (!inode)
900 goto err_file; 909 goto err_file;
901 910
902 this.len = sprintf(name, "[%lu]", inode->i_ino);
903 this.name = name;
904 this.hash = 0;
905 err = -ENOMEM; 911 err = -ENOMEM;
906 dentry = d_alloc(pipe_mnt->mnt_sb->s_root, &this); 912 dentry = d_alloc(pipe_mnt->mnt_sb->s_root, &name);
907 if (!dentry) 913 if (!dentry)
908 goto err_inode; 914 goto err_inode;
909 915