gfs2: convert to ctime accessor functions
[linux-2.6-microblaze.git] / fs / gfs2 / dir.c
index 54a6d17..1a2afa8 100644 (file)
@@ -130,7 +130,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf,
        memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size);
        if (ip->i_inode.i_size < offset + size)
                i_size_write(&ip->i_inode, offset + size);
-       ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
+       ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode);
        gfs2_dinode_out(ip, dibh->b_data);
 
        brelse(dibh);
@@ -227,7 +227,7 @@ out:
 
        if (ip->i_inode.i_size < offset + copied)
                i_size_write(&ip->i_inode, offset + copied);
-       ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
+       ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode);
 
        gfs2_trans_add_meta(ip->i_gl, dibh);
        gfs2_dinode_out(ip, dibh->b_data);
@@ -1814,7 +1814,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,
                        gfs2_inum_out(nip, dent);
                        dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode));
                        dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip));
-                       tv = current_time(&ip->i_inode);
+                       tv = inode_set_ctime_current(&ip->i_inode);
                        if (ip->i_diskflags & GFS2_DIF_EXHASH) {
                                leaf = (struct gfs2_leaf *)bh->b_data;
                                be16_add_cpu(&leaf->lf_entries, 1);
@@ -1825,7 +1825,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,
                        da->bh = NULL;
                        brelse(bh);
                        ip->i_entries++;
-                       ip->i_inode.i_mtime = ip->i_inode.i_ctime = tv;
+                       ip->i_inode.i_mtime = tv;
                        if (S_ISDIR(nip->i_inode.i_mode))
                                inc_nlink(&ip->i_inode);
                        mark_inode_dirty(inode);
@@ -1876,7 +1876,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry)
        const struct qstr *name = &dentry->d_name;
        struct gfs2_dirent *dent, *prev = NULL;
        struct buffer_head *bh;
-       struct timespec64 tv = current_time(&dip->i_inode);
+       struct timespec64 tv;
 
        /* Returns _either_ the entry (if its first in block) or the
           previous entry otherwise */
@@ -1896,6 +1896,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry)
        }
 
        dirent_del(dip, bh, prev, dent);
+       tv = inode_set_ctime_current(&dip->i_inode);
        if (dip->i_diskflags & GFS2_DIF_EXHASH) {
                struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data;
                u16 entries = be16_to_cpu(leaf->lf_entries);
@@ -1910,7 +1911,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry)
        if (!dip->i_entries)
                gfs2_consist_inode(dip);
        dip->i_entries--;
-       dip->i_inode.i_mtime = dip->i_inode.i_ctime = tv;
+       dip->i_inode.i_mtime =  tv;
        if (d_is_dir(dentry))
                drop_nlink(&dip->i_inode);
        mark_inode_dirty(&dip->i_inode);
@@ -1951,7 +1952,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
        dent->de_type = cpu_to_be16(new_type);
        brelse(bh);
 
-       dip->i_inode.i_mtime = dip->i_inode.i_ctime = current_time(&dip->i_inode);
+       dip->i_inode.i_mtime = inode_set_ctime_current(&dip->i_inode);
        mark_inode_dirty_sync(&dip->i_inode);
        return 0;
 }