aboutsummaryrefslogtreecommitdiffstats
path: root/fs/debugfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r--fs/debugfs/inode.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index e8ae3042b806..269e649e6dc6 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -40,7 +40,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t d
40 inode->i_mode = mode; 40 inode->i_mode = mode;
41 inode->i_uid = 0; 41 inode->i_uid = 0;
42 inode->i_gid = 0; 42 inode->i_gid = 0;
43 inode->i_blksize = PAGE_CACHE_SIZE;
44 inode->i_blocks = 0; 43 inode->i_blocks = 0;
45 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 44 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
46 switch (mode & S_IFMT) { 45 switch (mode & S_IFMT) {
@@ -162,14 +161,13 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
162 161
163/** 162/**
164 * debugfs_create_file - create a file in the debugfs filesystem 163 * debugfs_create_file - create a file in the debugfs filesystem
165 *
166 * @name: a pointer to a string containing the name of the file to create. 164 * @name: a pointer to a string containing the name of the file to create.
167 * @mode: the permission that the file should have 165 * @mode: the permission that the file should have
168 * @parent: a pointer to the parent dentry for this file. This should be a 166 * @parent: a pointer to the parent dentry for this file. This should be a
169 * directory dentry if set. If this paramater is NULL, then the 167 * directory dentry if set. If this paramater is NULL, then the
170 * file will be created in the root of the debugfs filesystem. 168 * file will be created in the root of the debugfs filesystem.
171 * @data: a pointer to something that the caller will want to get to later 169 * @data: a pointer to something that the caller will want to get to later
172 * on. The inode.u.generic_ip pointer will point to this value on 170 * on. The inode.i_private pointer will point to this value on
173 * the open() call. 171 * the open() call.
174 * @fops: a pointer to a struct file_operations that should be used for 172 * @fops: a pointer to a struct file_operations that should be used for
175 * this file. 173 * this file.
@@ -182,11 +180,11 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
182 * This function will return a pointer to a dentry if it succeeds. This 180 * This function will return a pointer to a dentry if it succeeds. This
183 * pointer must be passed to the debugfs_remove() function when the file is 181 * pointer must be passed to the debugfs_remove() function when the file is
184 * to be removed (no automatic cleanup happens if your module is unloaded, 182 * to be removed (no automatic cleanup happens if your module is unloaded,
185 * you are responsible here.) If an error occurs, NULL will be returned. 183 * you are responsible here.) If an error occurs, %NULL will be returned.
186 * 184 *
187 * If debugfs is not enabled in the kernel, the value -ENODEV will be 185 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
188 * returned. It is not wise to check for this value, but rather, check for 186 * returned. It is not wise to check for this value, but rather, check for
189 * NULL or !NULL instead as to eliminate the need for #ifdef in the calling 187 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
190 * code. 188 * code.
191 */ 189 */
192struct dentry *debugfs_create_file(const char *name, mode_t mode, 190struct dentry *debugfs_create_file(const char *name, mode_t mode,
@@ -210,7 +208,7 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode,
210 208
211 if (dentry->d_inode) { 209 if (dentry->d_inode) {
212 if (data) 210 if (data)
213 dentry->d_inode->u.generic_ip = data; 211 dentry->d_inode->i_private = data;
214 if (fops) 212 if (fops)
215 dentry->d_inode->i_fop = fops; 213 dentry->d_inode->i_fop = fops;
216 } 214 }
@@ -221,7 +219,6 @@ EXPORT_SYMBOL_GPL(debugfs_create_file);
221 219
222/** 220/**
223 * debugfs_create_dir - create a directory in the debugfs filesystem 221 * debugfs_create_dir - create a directory in the debugfs filesystem
224 *
225 * @name: a pointer to a string containing the name of the directory to 222 * @name: a pointer to a string containing the name of the directory to
226 * create. 223 * create.
227 * @parent: a pointer to the parent dentry for this file. This should be a 224 * @parent: a pointer to the parent dentry for this file. This should be a
@@ -233,11 +230,11 @@ EXPORT_SYMBOL_GPL(debugfs_create_file);
233 * This function will return a pointer to a dentry if it succeeds. This 230 * This function will return a pointer to a dentry if it succeeds. This
234 * pointer must be passed to the debugfs_remove() function when the file is 231 * pointer must be passed to the debugfs_remove() function when the file is
235 * to be removed (no automatic cleanup happens if your module is unloaded, 232 * to be removed (no automatic cleanup happens if your module is unloaded,
236 * you are responsible here.) If an error occurs, NULL will be returned. 233 * you are responsible here.) If an error occurs, %NULL will be returned.
237 * 234 *
238 * If debugfs is not enabled in the kernel, the value -ENODEV will be 235 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
239 * returned. It is not wise to check for this value, but rather, check for 236 * returned. It is not wise to check for this value, but rather, check for
240 * NULL or !NULL instead as to eliminate the need for #ifdef in the calling 237 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
241 * code. 238 * code.
242 */ 239 */
243struct dentry *debugfs_create_dir(const char *name, struct dentry *parent) 240struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
@@ -250,7 +247,6 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
250 247
251/** 248/**
252 * debugfs_remove - removes a file or directory from the debugfs filesystem 249 * debugfs_remove - removes a file or directory from the debugfs filesystem
253 *
254 * @dentry: a pointer to a the dentry of the file or directory to be 250 * @dentry: a pointer to a the dentry of the file or directory to be
255 * removed. 251 * removed.
256 * 252 *