diff options
Diffstat (limited to 'fs/debugfs')
| -rw-r--r-- | fs/debugfs/file.c | 77 | ||||
| -rw-r--r-- | fs/debugfs/inode.c | 12 | 
2 files changed, 38 insertions, 51 deletions
| diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 4fce1da7db23..ddd708b09fa1 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -394,12 +394,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u8_wo, NULL, debugfs_u8_set, "%llu\n");   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_u8(const char *name, umode_t mode,  				 struct dentry *parent, u8 *value) @@ -440,12 +439,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u16_wo, NULL, debugfs_u16_set, "%llu\n");   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_u16(const char *name, umode_t mode,  				  struct dentry *parent, u16 *value) @@ -486,12 +484,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u32_wo, NULL, debugfs_u32_set, "%llu\n");   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_u32(const char *name, umode_t mode,  				 struct dentry *parent, u32 *value) @@ -533,12 +530,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u64_wo, NULL, debugfs_u64_set, "%llu\n");   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_u64(const char *name, umode_t mode,  				 struct dentry *parent, u64 *value) @@ -582,12 +578,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_ulong_wo, NULL, debugfs_ulong_set, "%llu\n");   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_ulong(const char *name, umode_t mode,  				    struct dentry *parent, unsigned long *value) @@ -850,12 +845,11 @@ static const struct file_operations fops_bool_wo = {   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_bool(const char *name, umode_t mode,  				   struct dentry *parent, bool *value) @@ -904,12 +898,11 @@ static const struct file_operations fops_blob = {   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_blob(const char *name, umode_t mode,  				   struct dentry *parent, @@ -1005,8 +998,9 @@ static const struct file_operations u32_array_fops = {   * Writing is not supported. Seek within the file is also not supported.   * Once array is created its size can not be changed.   * - * The function returns a pointer to dentry on success. If debugfs is not - * enabled in the kernel, the value -%ENODEV will be returned. + * The function returns a pointer to dentry on success. If an error occurs, + * %ERR_PTR(-ERROR) or NULL will be returned. If debugfs is not enabled in + * the kernel, the value %ERR_PTR(-ENODEV) will be returned.   */  struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,  					    struct dentry *parent, @@ -1102,12 +1096,11 @@ static const struct file_operations fops_regset32 = {   * This function will return a pointer to a dentry if it succeeds.  This   * pointer must be passed to the debugfs_remove() function when the file is   * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here.)  If an error occurs, %NULL will be returned. + * you are responsible here.)  If an error occurs, %ERR_PTR(-ERROR) will be + * returned.   * - * If debugfs is not enabled in the kernel, the value -%ENODEV will be - * returned.  It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will + * be returned.   */  struct dentry *debugfs_create_regset32(const char *name, umode_t mode,  				       struct dentry *parent, diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index f25daa207421..acef14ad53db 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -163,24 +163,18 @@ static int debugfs_show_options(struct seq_file *m, struct dentry *root)  	return 0;  } -static void debugfs_i_callback(struct rcu_head *head) +static void debugfs_free_inode(struct inode *inode)  { -	struct inode *inode = container_of(head, struct inode, i_rcu);  	if (S_ISLNK(inode->i_mode))  		kfree(inode->i_link);  	free_inode_nonrcu(inode);  } -static void debugfs_destroy_inode(struct inode *inode) -{ -	call_rcu(&inode->i_rcu, debugfs_i_callback); -} -  static const struct super_operations debugfs_super_operations = {  	.statfs		= simple_statfs,  	.remount_fs	= debugfs_remount,  	.show_options	= debugfs_show_options, -	.destroy_inode	= debugfs_destroy_inode, +	.free_inode	= debugfs_free_inode,  };  static void debugfs_release_dentry(struct dentry *dentry) @@ -824,7 +818,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,  		goto exit;  	}  	d_move(old_dentry, dentry); -	fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name.name, +	fsnotify_move(d_inode(old_dir), d_inode(new_dir), &old_name.name,  		d_is_dir(old_dentry),  		NULL, old_dentry);  	release_dentry_name_snapshot(&old_name); |