diff options
| author | Miklos Szeredi <mszeredi@suse.cz> | 2011-10-28 08:13:29 -0400 |
|---|---|---|
| committer | Christoph Hellwig <hch@serles.lst.de> | 2011-11-02 07:53:43 -0400 |
| commit | bfe8684869601dacfcb2cd69ef8cfd9045f62170 (patch) | |
| tree | 4e213aaa766b26f43f0f9ec7998a7745239d9377 /include | |
| parent | 6d6b77f163c7eabedbba00ed2abb7d4a570bff76 (diff) | |
filesystems: add set_nlink()
Replace remaining direct i_nlink updates with a new set_nlink()
updater function.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7a049fd2aa4c..48c1f5fc7411 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1755,6 +1755,19 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
| 1755 | } | 1755 | } |
| 1756 | 1756 | ||
| 1757 | /** | 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 | |||
| 1770 | /** | ||
| 1758 | * inc_nlink - directly increment an inode's link count | 1771 | * inc_nlink - directly increment an inode's link count |
| 1759 | * @inode: inode | 1772 | * @inode: inode |
| 1760 | * | 1773 | * |
