fs: Add helper to clean bdev aliases under a bh and use it
[sfrench/cifs-2.6.git] / fs / ufs / inode.c
index 9f49431e798d6778f371eb482eed0c0390c250c4..45ceb94e89e42a362d633a35d2861e2808910e1a 100644 (file)
@@ -293,7 +293,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index,
 
        if (new)
                *new = 1;
-       inode->i_ctime = CURRENT_TIME_SEC;
+       inode->i_ctime = current_time(inode);
        if (IS_SYNC(inode))
                ufs_sync_inode (inode);
        mark_inode_dirty(inode);
@@ -375,7 +375,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block,
        mark_buffer_dirty(bh);
        if (IS_SYNC(inode))
                sync_dirty_buffer(bh);
-       inode->i_ctime = CURRENT_TIME_SEC;
+       inode->i_ctime = current_time(inode);
        mark_inode_dirty(inode);
 out:
        brelse (bh);
@@ -1070,8 +1070,7 @@ static int ufs_alloc_lastblock(struct inode *inode, loff_t size)
 
        if (buffer_new(bh)) {
               clear_buffer_new(bh);
-              unmap_underlying_metadata(bh->b_bdev,
-                                        bh->b_blocknr);
+              clean_bdev_bh_alias(bh);
               /*
                * we do not zeroize fragment, because of
                * if it maped to hole, it already contains zeroes
@@ -1185,7 +1184,7 @@ static int ufs_truncate(struct inode *inode, loff_t size)
        truncate_setsize(inode, size);
 
        __ufs_truncate_blocks(inode);
-       inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
+       inode->i_mtime = inode->i_ctime = current_time(inode);
        mark_inode_dirty(inode);
 out:
        UFSD("EXIT: err %d\n", err);
@@ -1208,7 +1207,7 @@ int ufs_setattr(struct dentry *dentry, struct iattr *attr)
        unsigned int ia_valid = attr->ia_valid;
        int error;
 
-       error = inode_change_ok(inode, attr);
+       error = setattr_prepare(dentry, attr);
        if (error)
                return error;