Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

document nlink function

These should have been documented from the beginning. Fix it.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dave Hansen and committed by
Linus Torvalds
71c42157 0faa4548

+27
+27
include/linux/fs.h
··· 1211 1211 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1212 1212 } 1213 1213 1214 + /** 1215 + * inc_nlink - directly increment an inode's link count 1216 + * @inode: inode 1217 + * 1218 + * This is a low-level filesystem helper to replace any 1219 + * direct filesystem manipulation of i_nlink. Currently, 1220 + * it is only here for parity with dec_nlink(). 1221 + */ 1214 1222 static inline void inc_nlink(struct inode *inode) 1215 1223 { 1216 1224 inode->i_nlink++; ··· 1230 1222 mark_inode_dirty(inode); 1231 1223 } 1232 1224 1225 + /** 1226 + * drop_nlink - directly drop an inode's link count 1227 + * @inode: inode 1228 + * 1229 + * This is a low-level filesystem helper to replace any 1230 + * direct filesystem manipulation of i_nlink. In cases 1231 + * where we are attempting to track writes to the 1232 + * filesystem, a decrement to zero means an imminent 1233 + * write when the file is truncated and actually unlinked 1234 + * on the filesystem. 1235 + */ 1233 1236 static inline void drop_nlink(struct inode *inode) 1234 1237 { 1235 1238 inode->i_nlink--; 1236 1239 } 1237 1240 1241 + /** 1242 + * clear_nlink - directly zero an inode's link count 1243 + * @inode: inode 1244 + * 1245 + * This is a low-level filesystem helper to replace any 1246 + * direct filesystem manipulation of i_nlink. See 1247 + * drop_nlink() for why we care about i_nlink hitting zero. 1248 + */ 1238 1249 static inline void clear_nlink(struct inode *inode) 1239 1250 { 1240 1251 inode->i_nlink = 0;