diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-09-16 06:44:21 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-09-16 06:44:21 -0400 |
commit | a00be0e31f8df453ecbaaa4ba78d2ef935ab252e (patch) | |
tree | 75c1e8e88132090b5d8721ab927cd053a24b2ff3 | |
parent | beaf226b863a0bea28f2a6985555401450e968b2 (diff) |
cifs: don't use ->d_time
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>
-rw-r--r-- | fs/cifs/cifsfs.h | 10 | ||||
-rw-r--r-- | fs/cifs/dir.c | 6 | ||||
-rw-r--r-- | fs/cifs/inode.c | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 9dcf974acc47..c9c00a862036 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -41,6 +41,16 @@ cifs_uniqueid_to_ino_t(u64 fileid) | |||
41 | 41 | ||
42 | } | 42 | } |
43 | 43 | ||
44 | static inline void cifs_set_time(struct dentry *dentry, unsigned long time) | ||
45 | { | ||
46 | dentry->d_fsdata = (void *) time; | ||
47 | } | ||
48 | |||
49 | static inline unsigned long cifs_get_time(struct dentry *dentry) | ||
50 | { | ||
51 | return (unsigned long) dentry->d_fsdata; | ||
52 | } | ||
53 | |||
44 | extern struct file_system_type cifs_fs_type; | 54 | extern struct file_system_type cifs_fs_type; |
45 | extern const struct address_space_operations cifs_addr_ops; | 55 | extern const struct address_space_operations cifs_addr_ops; |
46 | extern const struct address_space_operations cifs_addr_ops_smallbuf; | 56 | extern const struct address_space_operations cifs_addr_ops_smallbuf; |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 4716c54dbfc6..789ff1df2d8d 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -40,7 +40,7 @@ renew_parental_timestamps(struct dentry *direntry) | |||
40 | /* BB check if there is a way to get the kernel to do this or if we | 40 | /* BB check if there is a way to get the kernel to do this or if we |
41 | really need this */ | 41 | really need this */ |
42 | do { | 42 | do { |
43 | direntry->d_time = jiffies; | 43 | cifs_set_time(direntry, jiffies); |
44 | direntry = direntry->d_parent; | 44 | direntry = direntry->d_parent; |
45 | } while (!IS_ROOT(direntry)); | 45 | } while (!IS_ROOT(direntry)); |
46 | } | 46 | } |
@@ -802,7 +802,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
802 | 802 | ||
803 | } else if (rc == -ENOENT) { | 803 | } else if (rc == -ENOENT) { |
804 | rc = 0; | 804 | rc = 0; |
805 | direntry->d_time = jiffies; | 805 | cifs_set_time(direntry, jiffies); |
806 | d_add(direntry, NULL); | 806 | d_add(direntry, NULL); |
807 | /* if it was once a directory (but how can we tell?) we could do | 807 | /* if it was once a directory (but how can we tell?) we could do |
808 | shrink_dcache_parent(direntry); */ | 808 | shrink_dcache_parent(direntry); */ |
@@ -862,7 +862,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags) | |||
862 | if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET)) | 862 | if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET)) |
863 | return 0; | 863 | return 0; |
864 | 864 | ||
865 | if (time_after(jiffies, direntry->d_time + HZ) || !lookupCacheEnabled) | 865 | if (time_after(jiffies, cifs_get_time(direntry) + HZ) || !lookupCacheEnabled) |
866 | return 0; | 866 | return 0; |
867 | 867 | ||
868 | return 1; | 868 | return 1; |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index b87efd0c92d6..0b4a35514351 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1951,7 +1951,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry) | |||
1951 | 1951 | ||
1952 | cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n", | 1952 | cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n", |
1953 | full_path, inode, inode->i_count.counter, | 1953 | full_path, inode, inode->i_count.counter, |
1954 | dentry, dentry->d_time, jiffies); | 1954 | dentry, cifs_get_time(dentry), jiffies); |
1955 | 1955 | ||
1956 | if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext) | 1956 | if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext) |
1957 | rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid); | 1957 | rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid); |