aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/debugfs/inode.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 79f53f3ce7c6..d17c20fd74e6 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -54,13 +54,12 @@ static struct inode *debugfs_get_inode(struct super_block *sb, umode_t mode, dev
54 break; 54 break;
55 case S_IFLNK: 55 case S_IFLNK:
56 inode->i_op = &debugfs_link_operations; 56 inode->i_op = &debugfs_link_operations;
57 inode->i_fop = fops;
58 inode->i_private = data; 57 inode->i_private = data;
59 break; 58 break;
60 case S_IFDIR: 59 case S_IFDIR:
61 inode->i_op = &simple_dir_inode_operations; 60 inode->i_op = &simple_dir_inode_operations;
62 inode->i_fop = fops ? fops : &simple_dir_operations; 61 inode->i_fop = &simple_dir_operations;
63 inode->i_private = data; 62 inode->i_private = NULL;
64 63
65 /* directory inodes start off with i_nlink == 2 64 /* directory inodes start off with i_nlink == 2
66 * (for "." entry) */ 65 * (for "." entry) */
@@ -91,13 +90,12 @@ static int debugfs_mknod(struct inode *dir, struct dentry *dentry,
91 return error; 90 return error;
92} 91}
93 92
94static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode, 93static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
95 void *data, const struct file_operations *fops)
96{ 94{
97 int res; 95 int res;
98 96
99 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR; 97 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR;
100 res = debugfs_mknod(dir, dentry, mode, 0, data, fops); 98 res = debugfs_mknod(dir, dentry, mode, 0, NULL, NULL);
101 if (!res) { 99 if (!res) {
102 inc_nlink(dir); 100 inc_nlink(dir);
103 fsnotify_mkdir(dir, dentry); 101 fsnotify_mkdir(dir, dentry);
@@ -106,10 +104,10 @@ static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode,
106} 104}
107 105
108static int debugfs_link(struct inode *dir, struct dentry *dentry, umode_t mode, 106static int debugfs_link(struct inode *dir, struct dentry *dentry, umode_t mode,
109 void *data, const struct file_operations *fops) 107 void *data)
110{ 108{
111 mode = (mode & S_IALLUGO) | S_IFLNK; 109 mode = (mode & S_IALLUGO) | S_IFLNK;
112 return debugfs_mknod(dir, dentry, mode, 0, data, fops); 110 return debugfs_mknod(dir, dentry, mode, 0, data, NULL);
113} 111}
114 112
115static int debugfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 113static int debugfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
@@ -321,12 +319,12 @@ struct dentry *__create_file(const char *name, umode_t mode,
321 if (!IS_ERR(dentry)) { 319 if (!IS_ERR(dentry)) {
322 switch (mode & S_IFMT) { 320 switch (mode & S_IFMT) {
323 case S_IFDIR: 321 case S_IFDIR:
324 error = debugfs_mkdir(parent->d_inode, dentry, mode, 322 error = debugfs_mkdir(parent->d_inode, dentry, mode);
325 data, fops); 323
326 break; 324 break;
327 case S_IFLNK: 325 case S_IFLNK:
328 error = debugfs_link(parent->d_inode, dentry, mode, 326 error = debugfs_link(parent->d_inode, dentry, mode,
329 data, fops); 327 data);
330 break; 328 break;
331 default: 329 default:
332 error = debugfs_create(parent->d_inode, dentry, mode, 330 error = debugfs_create(parent->d_inode, dentry, mode,