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/udf | |
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/udf')
-rw-r--r-- | fs/udf/inode.c | 8 | ||||
-rw-r--r-- | fs/udf/namei.c | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 1d1358ed80c1..6e73f1d6e93c 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1236,6 +1236,7 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) | |||
1236 | int offset; | 1236 | int offset; |
1237 | struct udf_sb_info *sbi = UDF_SB(inode->i_sb); | 1237 | struct udf_sb_info *sbi = UDF_SB(inode->i_sb); |
1238 | struct udf_inode_info *iinfo = UDF_I(inode); | 1238 | struct udf_inode_info *iinfo = UDF_I(inode); |
1239 | unsigned int link_count; | ||
1239 | 1240 | ||
1240 | fe = (struct fileEntry *)bh->b_data; | 1241 | fe = (struct fileEntry *)bh->b_data; |
1241 | efe = (struct extendedFileEntry *)bh->b_data; | 1242 | efe = (struct extendedFileEntry *)bh->b_data; |
@@ -1318,9 +1319,10 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) | |||
1318 | inode->i_mode &= ~sbi->s_umask; | 1319 | inode->i_mode &= ~sbi->s_umask; |
1319 | read_unlock(&sbi->s_cred_lock); | 1320 | read_unlock(&sbi->s_cred_lock); |
1320 | 1321 | ||
1321 | inode->i_nlink = le16_to_cpu(fe->fileLinkCount); | 1322 | link_count = le16_to_cpu(fe->fileLinkCount); |
1322 | if (!inode->i_nlink) | 1323 | if (!link_count) |
1323 | inode->i_nlink = 1; | 1324 | link_count = 1; |
1325 | set_nlink(inode, link_count); | ||
1324 | 1326 | ||
1325 | inode->i_size = le64_to_cpu(fe->informationLength); | 1327 | inode->i_size = le64_to_cpu(fe->informationLength); |
1326 | iinfo->i_lenExtents = inode->i_size; | 1328 | iinfo->i_lenExtents = inode->i_size; |
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index e8d61b114c1b..f1c64c6a4532 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -667,7 +667,7 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
667 | iput(inode); | 667 | iput(inode); |
668 | goto out; | 668 | goto out; |
669 | } | 669 | } |
670 | inode->i_nlink = 2; | 670 | set_nlink(inode, 2); |
671 | cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); | 671 | cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); |
672 | cfi.icb.extLocation = cpu_to_lelb(dinfo->i_location); | 672 | cfi.icb.extLocation = cpu_to_lelb(dinfo->i_location); |
673 | *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = | 673 | *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = |
@@ -837,7 +837,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) | |||
837 | if (!inode->i_nlink) { | 837 | if (!inode->i_nlink) { |
838 | udf_debug("Deleting nonexistent file (%lu), %d\n", | 838 | udf_debug("Deleting nonexistent file (%lu), %d\n", |
839 | inode->i_ino, inode->i_nlink); | 839 | inode->i_ino, inode->i_nlink); |
840 | inode->i_nlink = 1; | 840 | set_nlink(inode, 1); |
841 | } | 841 | } |
842 | retval = udf_delete_entry(dir, fi, &fibh, &cfi); | 842 | retval = udf_delete_entry(dir, fi, &fibh, &cfi); |
843 | if (retval) | 843 | if (retval) |