diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-03-19 07:28:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-23 18:01:59 -0400 |
commit | db6172c41194576ba2a27e64fa2a5576d11d6eb9 (patch) | |
tree | 8f0090f98145fc51ec956d39d38d41fe757755f4 /fs | |
parent | 8ea3a7c0df05b2cb33e2d63aa1c964308724b1c4 (diff) |
fs: cleanup slight list_entry abuse
list_entry is just a wrapper for container_of, but it is arguably
wrong (and slightly confusing) to use it when the pointed-to struct
member is not a struct list_head. Use container_of directly instead.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/affs/affs.h | 2 | ||||
-rw-r--r-- | fs/befs/befs.h | 2 | ||||
-rw-r--r-- | fs/coda/coda_linux.h | 2 | ||||
-rw-r--r-- | fs/hfs/hfs_fs.h | 2 | ||||
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 2 | ||||
-rw-r--r-- | fs/hpfs/hpfs_fn.h | 2 | ||||
-rw-r--r-- | fs/jffs2/os-linux.h | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_incore.h | 2 | ||||
-rw-r--r-- | fs/minix/minix.h | 2 | ||||
-rw-r--r-- | fs/ntfs/inode.h | 2 | ||||
-rw-r--r-- | fs/squashfs/squashfs_fs_i.h | 2 | ||||
-rw-r--r-- | fs/sysv/sysv.h | 2 | ||||
-rw-r--r-- | fs/udf/udf_i.h | 2 |
13 files changed, 13 insertions, 13 deletions
diff --git a/fs/affs/affs.h b/fs/affs/affs.h index cffe8370fb44..c69a87eaf57d 100644 --- a/fs/affs/affs.h +++ b/fs/affs/affs.h | |||
@@ -64,7 +64,7 @@ struct affs_inode_info { | |||
64 | /* short cut to get to the affs specific inode data */ | 64 | /* short cut to get to the affs specific inode data */ |
65 | static inline struct affs_inode_info *AFFS_I(struct inode *inode) | 65 | static inline struct affs_inode_info *AFFS_I(struct inode *inode) |
66 | { | 66 | { |
67 | return list_entry(inode, struct affs_inode_info, vfs_inode); | 67 | return container_of(inode, struct affs_inode_info, vfs_inode); |
68 | } | 68 | } |
69 | 69 | ||
70 | /* | 70 | /* |
diff --git a/fs/befs/befs.h b/fs/befs/befs.h index 1fead8d56a98..35d19e8731e3 100644 --- a/fs/befs/befs.h +++ b/fs/befs/befs.h | |||
@@ -112,7 +112,7 @@ BEFS_SB(const struct super_block *super) | |||
112 | static inline struct befs_inode_info * | 112 | static inline struct befs_inode_info * |
113 | BEFS_I(const struct inode *inode) | 113 | BEFS_I(const struct inode *inode) |
114 | { | 114 | { |
115 | return list_entry(inode, struct befs_inode_info, vfs_inode); | 115 | return container_of(inode, struct befs_inode_info, vfs_inode); |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline befs_blocknr_t | 118 | static inline befs_blocknr_t |
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h index d6f7a76a1f5b..f829fe963f5b 100644 --- a/fs/coda/coda_linux.h +++ b/fs/coda/coda_linux.h | |||
@@ -79,7 +79,7 @@ void coda_sysctl_clean(void); | |||
79 | 79 | ||
80 | static inline struct coda_inode_info *ITOC(struct inode *inode) | 80 | static inline struct coda_inode_info *ITOC(struct inode *inode) |
81 | { | 81 | { |
82 | return list_entry(inode, struct coda_inode_info, vfs_inode); | 82 | return container_of(inode, struct coda_inode_info, vfs_inode); |
83 | } | 83 | } |
84 | 84 | ||
85 | static __inline__ struct CodaFid *coda_i2f(struct inode *inode) | 85 | static __inline__ struct CodaFid *coda_i2f(struct inode *inode) |
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index 95d255219b1e..1f1c7dcbcc2f 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h | |||
@@ -252,7 +252,7 @@ extern void hfs_mark_mdb_dirty(struct super_block *sb); | |||
252 | #define __hfs_u_to_mtime(sec) cpu_to_be32(sec + 2082844800U - sys_tz.tz_minuteswest * 60) | 252 | #define __hfs_u_to_mtime(sec) cpu_to_be32(sec + 2082844800U - sys_tz.tz_minuteswest * 60) |
253 | #define __hfs_m_to_utime(sec) (be32_to_cpu(sec) - 2082844800U + sys_tz.tz_minuteswest * 60) | 253 | #define __hfs_m_to_utime(sec) (be32_to_cpu(sec) - 2082844800U + sys_tz.tz_minuteswest * 60) |
254 | 254 | ||
255 | #define HFS_I(inode) (list_entry(inode, struct hfs_inode_info, vfs_inode)) | 255 | #define HFS_I(inode) (container_of(inode, struct hfs_inode_info, vfs_inode)) |
256 | #define HFS_SB(sb) ((struct hfs_sb_info *)(sb)->s_fs_info) | 256 | #define HFS_SB(sb) ((struct hfs_sb_info *)(sb)->s_fs_info) |
257 | 257 | ||
258 | #define hfs_m_to_utime(time) (struct timespec){ .tv_sec = __hfs_m_to_utime(time) } | 258 | #define hfs_m_to_utime(time) (struct timespec){ .tv_sec = __hfs_m_to_utime(time) } |
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index b0441d65fa54..f91a1faf819e 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h | |||
@@ -263,7 +263,7 @@ struct hfsplus_inode_info { | |||
263 | 263 | ||
264 | static inline struct hfsplus_inode_info *HFSPLUS_I(struct inode *inode) | 264 | static inline struct hfsplus_inode_info *HFSPLUS_I(struct inode *inode) |
265 | { | 265 | { |
266 | return list_entry(inode, struct hfsplus_inode_info, vfs_inode); | 266 | return container_of(inode, struct hfsplus_inode_info, vfs_inode); |
267 | } | 267 | } |
268 | 268 | ||
269 | /* | 269 | /* |
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index b63b75fa00e7..bb04b58d1d69 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h | |||
@@ -304,7 +304,7 @@ extern const struct address_space_operations hpfs_symlink_aops; | |||
304 | 304 | ||
305 | static inline struct hpfs_inode_info *hpfs_i(struct inode *inode) | 305 | static inline struct hpfs_inode_info *hpfs_i(struct inode *inode) |
306 | { | 306 | { |
307 | return list_entry(inode, struct hpfs_inode_info, vfs_inode); | 307 | return container_of(inode, struct hpfs_inode_info, vfs_inode); |
308 | } | 308 | } |
309 | 309 | ||
310 | static inline struct hpfs_sb_info *hpfs_sb(struct super_block *sb) | 310 | static inline struct hpfs_sb_info *hpfs_sb(struct super_block *sb) |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index d200a9b8fd5e..824e61ede465 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -19,7 +19,7 @@ | |||
19 | struct kstatfs; | 19 | struct kstatfs; |
20 | struct kvec; | 20 | struct kvec; |
21 | 21 | ||
22 | #define JFFS2_INODE_INFO(i) (list_entry(i, struct jffs2_inode_info, vfs_inode)) | 22 | #define JFFS2_INODE_INFO(i) (container_of(i, struct jffs2_inode_info, vfs_inode)) |
23 | #define OFNI_EDONI_2SFFJ(f) (&(f)->vfs_inode) | 23 | #define OFNI_EDONI_2SFFJ(f) (&(f)->vfs_inode) |
24 | #define JFFS2_SB_INFO(sb) (sb->s_fs_info) | 24 | #define JFFS2_SB_INFO(sb) (sb->s_fs_info) |
25 | #define OFNI_BS_2SFFJ(c) ((struct super_block *)c->os_priv) | 25 | #define OFNI_BS_2SFFJ(c) ((struct super_block *)c->os_priv) |
diff --git a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h index fa7e795bd8ae..1f26d1910409 100644 --- a/fs/jfs/jfs_incore.h +++ b/fs/jfs/jfs_incore.h | |||
@@ -206,7 +206,7 @@ struct jfs_sb_info { | |||
206 | 206 | ||
207 | static inline struct jfs_inode_info *JFS_IP(struct inode *inode) | 207 | static inline struct jfs_inode_info *JFS_IP(struct inode *inode) |
208 | { | 208 | { |
209 | return list_entry(inode, struct jfs_inode_info, vfs_inode); | 209 | return container_of(inode, struct jfs_inode_info, vfs_inode); |
210 | } | 210 | } |
211 | 211 | ||
212 | static inline int jfs_dirtable_inline(struct inode *inode) | 212 | static inline int jfs_dirtable_inline(struct inode *inode) |
diff --git a/fs/minix/minix.h b/fs/minix/minix.h index 1ebd11854622..01ad81dcacc5 100644 --- a/fs/minix/minix.h +++ b/fs/minix/minix.h | |||
@@ -84,7 +84,7 @@ static inline struct minix_sb_info *minix_sb(struct super_block *sb) | |||
84 | 84 | ||
85 | static inline struct minix_inode_info *minix_i(struct inode *inode) | 85 | static inline struct minix_inode_info *minix_i(struct inode *inode) |
86 | { | 86 | { |
87 | return list_entry(inode, struct minix_inode_info, vfs_inode); | 87 | return container_of(inode, struct minix_inode_info, vfs_inode); |
88 | } | 88 | } |
89 | 89 | ||
90 | static inline unsigned minix_blocks_needed(unsigned bits, unsigned blocksize) | 90 | static inline unsigned minix_blocks_needed(unsigned bits, unsigned blocksize) |
diff --git a/fs/ntfs/inode.h b/fs/ntfs/inode.h index 76b6cfb579d7..b3c3469de6cb 100644 --- a/fs/ntfs/inode.h +++ b/fs/ntfs/inode.h | |||
@@ -239,7 +239,7 @@ typedef struct { | |||
239 | */ | 239 | */ |
240 | static inline ntfs_inode *NTFS_I(struct inode *inode) | 240 | static inline ntfs_inode *NTFS_I(struct inode *inode) |
241 | { | 241 | { |
242 | return (ntfs_inode *)list_entry(inode, big_ntfs_inode, vfs_inode); | 242 | return (ntfs_inode *)container_of(inode, big_ntfs_inode, vfs_inode); |
243 | } | 243 | } |
244 | 244 | ||
245 | static inline struct inode *VFS_I(ntfs_inode *ni) | 245 | static inline struct inode *VFS_I(ntfs_inode *ni) |
diff --git a/fs/squashfs/squashfs_fs_i.h b/fs/squashfs/squashfs_fs_i.h index 73588e7700ed..d09fcd6fb85d 100644 --- a/fs/squashfs/squashfs_fs_i.h +++ b/fs/squashfs/squashfs_fs_i.h | |||
@@ -49,6 +49,6 @@ struct squashfs_inode_info { | |||
49 | 49 | ||
50 | static inline struct squashfs_inode_info *squashfs_i(struct inode *inode) | 50 | static inline struct squashfs_inode_info *squashfs_i(struct inode *inode) |
51 | { | 51 | { |
52 | return list_entry(inode, struct squashfs_inode_info, vfs_inode); | 52 | return container_of(inode, struct squashfs_inode_info, vfs_inode); |
53 | } | 53 | } |
54 | #endif | 54 | #endif |
diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h index 2c13525131cd..6c212288adcb 100644 --- a/fs/sysv/sysv.h +++ b/fs/sysv/sysv.h | |||
@@ -73,7 +73,7 @@ struct sysv_inode_info { | |||
73 | 73 | ||
74 | static inline struct sysv_inode_info *SYSV_I(struct inode *inode) | 74 | static inline struct sysv_inode_info *SYSV_I(struct inode *inode) |
75 | { | 75 | { |
76 | return list_entry(inode, struct sysv_inode_info, vfs_inode); | 76 | return container_of(inode, struct sysv_inode_info, vfs_inode); |
77 | } | 77 | } |
78 | 78 | ||
79 | static inline struct sysv_sb_info *SYSV_SB(struct super_block *sb) | 79 | static inline struct sysv_sb_info *SYSV_SB(struct super_block *sb) |
diff --git a/fs/udf/udf_i.h b/fs/udf/udf_i.h index b5cd8ed2aa12..b1b9a63d8cf3 100644 --- a/fs/udf/udf_i.h +++ b/fs/udf/udf_i.h | |||
@@ -56,7 +56,7 @@ struct udf_inode_info { | |||
56 | 56 | ||
57 | static inline struct udf_inode_info *UDF_I(struct inode *inode) | 57 | static inline struct udf_inode_info *UDF_I(struct inode *inode) |
58 | { | 58 | { |
59 | return list_entry(inode, struct udf_inode_info, vfs_inode); | 59 | return container_of(inode, struct udf_inode_info, vfs_inode); |
60 | } | 60 | } |
61 | 61 | ||
62 | #endif /* _UDF_I_H) */ | 62 | #endif /* _UDF_I_H) */ |