Replace remaining direct i_nlink updates with a new set_nlink() updater function.
Showing the changes to include/linux (1 of 81 files). Show all
Unified · Split
| @@ -1754,6 +1754,19 @@ static inline void mark_inode_dirty_sync(struct inode *inode) · 1753 unmodified lines | ||
| 1754 | 1754 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
| 1755 | 1755 | } |
| 1756 | 1756 | |
| 1757 | +/** | |
| 1758 | + * set_nlink - directly set an inode's link count | |
| 1759 | + * @inode: inode | |
| 1760 | + * @nlink: new nlink (should be non-zero) | |
| 1761 | + * | |
| 1762 | + * This is a low-level filesystem helper to replace any | |
| 1763 | + * direct filesystem manipulation of i_nlink. | |
| 1764 | + */ | |
| 1765 | +static inline void set_nlink(struct inode *inode, unsigned int nlink) | |
| 1766 | +{ | |
| 1767 | + inode->i_nlink = nlink; | |
| 1768 | +} | |
| 1769 | + | |
| 1757 | 1770 | /** |
| 1758 | 1771 | * inc_nlink - directly increment an inode's link count |
| 1759 | 1772 | * @inode: inode |