cifs: don't use ->d_time
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 16 Sep 2016 10:44:21 +0000 (12:44 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 16 Sep 2016 10:44:21 +0000 (12:44 +0200)
Use d_fsdata instead, which is the same size.  Introduce helpers to hide
the typecasts.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: Steve French <sfrench@samba.org>
fs/cifs/cifsfs.h
fs/cifs/dir.c
fs/cifs/inode.c

index 9dcf974acc47f657ce5da39804bf7f887aeafc31..c9c00a862036f680af9e950c6ec13a2ca07ae854 100644 (file)
@@ -41,6 +41,16 @@ cifs_uniqueid_to_ino_t(u64 fileid)
 
 }
 
+static inline void cifs_set_time(struct dentry *dentry, unsigned long time)
+{
+       dentry->d_fsdata = (void *) time;
+}
+
+static inline unsigned long cifs_get_time(struct dentry *dentry)
+{
+       return (unsigned long) dentry->d_fsdata;
+}
+
 extern struct file_system_type cifs_fs_type;
 extern const struct address_space_operations cifs_addr_ops;
 extern const struct address_space_operations cifs_addr_ops_smallbuf;
index 4716c54dbfc64e91080b3fe9112ac17b1c7c5450..789ff1df2d8d5d1b6b923ee1f60428278a9d0319 100644 (file)
@@ -40,7 +40,7 @@ renew_parental_timestamps(struct dentry *direntry)
        /* BB check if there is a way to get the kernel to do this or if we
           really need this */
        do {
-               direntry->d_time = jiffies;
+               cifs_set_time(direntry, jiffies);
                direntry = direntry->d_parent;
        } while (!IS_ROOT(direntry));
 }
@@ -802,7 +802,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 
        } else if (rc == -ENOENT) {
                rc = 0;
-               direntry->d_time = jiffies;
+               cifs_set_time(direntry, jiffies);
                d_add(direntry, NULL);
        /*      if it was once a directory (but how can we tell?) we could do
                shrink_dcache_parent(direntry); */
@@ -862,7 +862,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
        if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
                return 0;
 
-       if (time_after(jiffies, direntry->d_time + HZ) || !lookupCacheEnabled)
+       if (time_after(jiffies, cifs_get_time(direntry) + HZ) || !lookupCacheEnabled)
                return 0;
 
        return 1;
index b87efd0c92d60adc82e54adcdafc4cab91007802..0b4a35514351aa5c40c18481afc6b89aea16b3ee 100644 (file)
@@ -1951,7 +1951,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
 
        cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n",
                 full_path, inode, inode->i_count.counter,
-                dentry, dentry->d_time, jiffies);
+                dentry, cifs_get_time(dentry), jiffies);
 
        if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext)
                rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid);