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 /fs/ecryptfs | |
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 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 11f8582d7218..a36d327f1521 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -474,8 +474,8 @@ static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, | |||
474 | goto out_lock; | 474 | goto out_lock; |
475 | fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); | 475 | fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); |
476 | fsstack_copy_inode_size(dir, lower_dir_dentry->d_inode); | 476 | fsstack_copy_inode_size(dir, lower_dir_dentry->d_inode); |
477 | old_dentry->d_inode->i_nlink = | 477 | set_nlink(old_dentry->d_inode, |
478 | ecryptfs_inode_to_lower(old_dentry->d_inode)->i_nlink; | 478 | ecryptfs_inode_to_lower(old_dentry->d_inode)->i_nlink); |
479 | i_size_write(new_dentry->d_inode, file_size_save); | 479 | i_size_write(new_dentry->d_inode, file_size_save); |
480 | out_lock: | 480 | out_lock: |
481 | unlock_dir(lower_dir_dentry); | 481 | unlock_dir(lower_dir_dentry); |
@@ -499,8 +499,8 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) | |||
499 | goto out_unlock; | 499 | goto out_unlock; |
500 | } | 500 | } |
501 | fsstack_copy_attr_times(dir, lower_dir_inode); | 501 | fsstack_copy_attr_times(dir, lower_dir_inode); |
502 | dentry->d_inode->i_nlink = | 502 | set_nlink(dentry->d_inode, |
503 | ecryptfs_inode_to_lower(dentry->d_inode)->i_nlink; | 503 | ecryptfs_inode_to_lower(dentry->d_inode)->i_nlink); |
504 | dentry->d_inode->i_ctime = dir->i_ctime; | 504 | dentry->d_inode->i_ctime = dir->i_ctime; |
505 | d_drop(dentry); | 505 | d_drop(dentry); |
506 | out_unlock: | 506 | out_unlock: |
@@ -565,7 +565,7 @@ static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
565 | goto out; | 565 | goto out; |
566 | fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); | 566 | fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); |
567 | fsstack_copy_inode_size(dir, lower_dir_dentry->d_inode); | 567 | fsstack_copy_inode_size(dir, lower_dir_dentry->d_inode); |
568 | dir->i_nlink = lower_dir_dentry->d_inode->i_nlink; | 568 | set_nlink(dir, lower_dir_dentry->d_inode->i_nlink); |
569 | out: | 569 | out: |
570 | unlock_dir(lower_dir_dentry); | 570 | unlock_dir(lower_dir_dentry); |
571 | if (!dentry->d_inode) | 571 | if (!dentry->d_inode) |
@@ -588,7 +588,7 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
588 | if (!rc && dentry->d_inode) | 588 | if (!rc && dentry->d_inode) |
589 | clear_nlink(dentry->d_inode); | 589 | clear_nlink(dentry->d_inode); |
590 | fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); | 590 | fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); |
591 | dir->i_nlink = lower_dir_dentry->d_inode->i_nlink; | 591 | set_nlink(dir, lower_dir_dentry->d_inode->i_nlink); |
592 | unlock_dir(lower_dir_dentry); | 592 | unlock_dir(lower_dir_dentry); |
593 | if (!rc) | 593 | if (!rc) |
594 | d_drop(dentry); | 594 | d_drop(dentry); |