Re: [PATCH v2 trivial] include/linux/dcache.h: Cleanup code and comments
From: Chen Gang
Date: Mon Jan 11 2016 - 09:56:12 EST
On 1/11/16 17:57, David Howells wrote:
> chengang@xxxxxxxxxxxxxxxx wrote:
>
>> -#define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry (maybe fallthru to nowhere) */
>> -#define DCACHE_WHITEOUT_TYPE 0x00100000 /* Whiteout dentry (stop pathwalk) */
>> -#define DCACHE_DIRECTORY_TYPE 0x00200000 /* Normal directory */
>> -#define DCACHE_AUTODIR_TYPE 0x00300000 /* Lookupless directory (presumed automount) */
>> -#define DCACHE_REGULAR_TYPE 0x00400000 /* Regular file type (or fallthru to such) */
>> -#define DCACHE_SPECIAL_TYPE 0x00500000 /* Other file type (or fallthru to such) */
>> -#define DCACHE_SYMLINK_TYPE 0x00600000 /* Symlink (or fallthru to such) */
>> +/* Negative dentry (maybe fallthru to nowhere) */
>> +#define DCACHE_MISS_TYPE 0x00000000
>> +/* Whiteout dentry (stop pathwalk) */
>> +#define DCACHE_WHITEOUT_TYPE 0x00100000
>> +/* Normal directory */
>> +#define DCACHE_DIRECTORY_TYPE 0x00200000
>> +/* Lookupless directory (presumed automount) */
>> +#define DCACHE_AUTODIR_TYPE 0x00300000
>> +/* Regular file type (or fallthru to such) */
>> +#define DCACHE_REGULAR_TYPE 0x00400000
>> +/* Other file type (or fallthru to such) */
>> +#define DCACHE_SPECIAL_TYPE 0x00500000
>> +/* Symlink (or fallthru to such) */
>> +#define DCACHE_SYMLINK_TYPE 0x00600000
>
> Please leave things like this as they were.
>
OK, thanks.
>> - * d_really_is_negative - Determine if a dentry is really negative (ignoring fallthroughs)
>> + * d_really_is_negative - Determine if a dentry is really negative (ignoring
>> + * fallthroughs)
>
> Does that break doc generation?
>
I guess no, the related contents are below:
[root@localhost linux-next]# make htmldocs
GEN Documentation/DocBook//v4l2.xml
HTML Documentation/DocBook/index.html
[root@localhost linux-next]# touch include/linux/dcache.h
[root@localhost linux-next]# make htmldocs
DOCPROC Documentation/DocBook/filesystems.xml
.//include/linux/jbd2.h:439: warning: No description found for parameter 'i_transaction'
.//include/linux/jbd2.h:439: warning: No description found for parameter 'i_next_transaction'
.//include/linux/jbd2.h:439: warning: No description found for parameter 'i_list'
.//include/linux/jbd2.h:439: warning: No description found for parameter 'i_vfs_inode'
.//include/linux/jbd2.h:439: warning: No description found for parameter 'i_flags'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_rsv_handle'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_reserved'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_type'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_line_no'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_start_jiffies'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_requested_credits'
.//include/linux/jbd2.h:495: warning: No description found for parameter 'h_lockdep_map'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_chkpt_bhs[JBD2_NR_BATCH]'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_devname[BDEVNAME_SIZE+24]'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_average_commit_time'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_min_batch_time'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_max_batch_time'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_commit_callback'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_failed_commit'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_chksum_driver'
.//include/linux/jbd2.h:1038: warning: No description found for parameter 'j_csum_seed'
.//include/linux/jbd2.h:1038: warning: Excess struct/union/enum/typedef member 'j_history' description in 'journal_s'
.//include/linux/jbd2.h:1038: warning: Excess struct/union/enum/typedef member 'j_history_max' description in 'journal_s'
.//include/linux/jbd2.h:1038: warning: Excess struct/union/enum/typedef member 'j_history_cur' description in 'journal_s'
.//fs/jbd2/transaction.c:429: warning: No description found for parameter 'rsv_blocks'
.//fs/jbd2/transaction.c:429: warning: No description found for parameter 'gfp_mask'
.//fs/jbd2/transaction.c:429: warning: No description found for parameter 'type'
.//fs/jbd2/transaction.c:429: warning: No description found for parameter 'line_no'
.//fs/jbd2/transaction.c:505: warning: No description found for parameter 'type'
.//fs/jbd2/transaction.c:505: warning: No description found for parameter 'line_no'
.//fs/jbd2/transaction.c:635: warning: No description found for parameter 'gfp_mask'
XMLREF Documentation/DocBook/filesystems.aux.xml
HTML Documentation/DocBook/filesystems.html
GEN Documentation/DocBook//v4l2.xml
HTML Documentation/DocBook/index.html
[root@localhost linux-next]#
> Is fudging the comments actually worth breaking git blame?
>
Excuse me, I am not quite familiar with git blame, the related result is
below, please help check (after apply this patch):
git blame include/linux/dcache.h
^1da177e4 (Linus Torvalds 2005-04-16 15:20:36 -0700 1) #ifndef __LINUX_DCACHE_H
^1da177e4 (Linus Torvalds 2005-04-16 15:20:36 -0700 2) #define __LINUX_DCACHE_H
^1da177e4 (Linus Torvalds 2005-04-16 15:20:36 -0700 3)
60063497a (Arun Sharma 2011-07-26 16:09:06 -0700 4) #include <linux/atomic.h>
...
b18825a7c (David Howells 2013-09-12 19:22:53 +0100 477)
525d27b23 (David Howells 2015-02-11 13:40:17 +0000 478) /**
53165fb00 (Chen Gang 2016-01-10 07:03:30 +0800 479) * d_really_is_negative - Determine if a dentry is really negative (ignoring
53165fb00 (Chen Gang 2016-01-10 07:03:30 +0800 480) * fallthroughs)
525d27b23 (David Howells 2015-02-11 13:40:17 +0000 481) * @dentry: The dentry in question
525d27b23 (David Howells 2015-02-11 13:40:17 +0000 482) *
...
155e35d4d (David Howells 2015-01-29 12:02:27 +0000 586) static inline struct dentry *d_backing_dentry(struct dentry *upper)
155e35d4d (David Howells 2015-01-29 12:02:27 +0000 587) {
155e35d4d (David Howells 2015-01-29 12:02:27 +0000 588) return upper;
155e35d4d (David Howells 2015-01-29 12:02:27 +0000 589) }
155e35d4d (David Howells 2015-01-29 12:02:27 +0000 590)
^1da177e4 (Linus Torvalds 2005-04-16 15:20:36 -0700 591) #endif /* __LINUX_DCACHE_H */
>> -static inline int simple_positive(struct dentry *dentry)
>> +static inline bool simple_positive(struct dentry *dentry)
>
> This is worth doing - gcc actually produces better code sometimes with the int
> -> bool switch. This should be a separate patch.
>
OK, I shall send a seperate patch for it.
Thanks
--
Chen Gang (éå)
Open, share, and attitude like air, water, and life which God blessed