Skip to content

Commit 1a3f1af

Browse files
author
Darrick J. Wong
committed
xfs: widen flags argument to the xfs_iflags_* helpers
xfs_inode.i_flags is an unsigned long, so make these helpers take that as the flags argument instead of unsigned short. This is needed for the next patch. While we're at it, remove the iflags variable from xfs_iget_cache_miss because we no longer need it. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Andrey Albershteyn <[email protected]>
1 parent 3791a05 commit 1a3f1af

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

fs/xfs/xfs_icache.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ xfs_iget_cache_miss(
613613
struct xfs_inode *ip;
614614
int error;
615615
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ino);
616-
int iflags;
617616

618617
ip = xfs_inode_alloc(mp, ino);
619618
if (!ip)
@@ -693,13 +692,12 @@ xfs_iget_cache_miss(
693692
* memory barrier that ensures this detection works correctly at lookup
694693
* time.
695694
*/
696-
iflags = XFS_INEW;
697695
if (flags & XFS_IGET_DONTCACHE)
698696
d_mark_dontcache(VFS_I(ip));
699697
ip->i_udquot = NULL;
700698
ip->i_gdquot = NULL;
701699
ip->i_pdquot = NULL;
702-
xfs_iflags_set(ip, iflags);
700+
xfs_iflags_set(ip, XFS_INEW);
703701

704702
/* insert the new inode */
705703
spin_lock(&pag->pag_ici_lock);

fs/xfs/xfs_inode.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,35 +207,35 @@ xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size)
207207
* i_flags helper functions
208208
*/
209209
static inline void
210-
__xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
210+
__xfs_iflags_set(xfs_inode_t *ip, unsigned long flags)
211211
{
212212
ip->i_flags |= flags;
213213
}
214214

215215
static inline void
216-
xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
216+
xfs_iflags_set(xfs_inode_t *ip, unsigned long flags)
217217
{
218218
spin_lock(&ip->i_flags_lock);
219219
__xfs_iflags_set(ip, flags);
220220
spin_unlock(&ip->i_flags_lock);
221221
}
222222

223223
static inline void
224-
xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
224+
xfs_iflags_clear(xfs_inode_t *ip, unsigned long flags)
225225
{
226226
spin_lock(&ip->i_flags_lock);
227227
ip->i_flags &= ~flags;
228228
spin_unlock(&ip->i_flags_lock);
229229
}
230230

231231
static inline int
232-
__xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
232+
__xfs_iflags_test(xfs_inode_t *ip, unsigned long flags)
233233
{
234234
return (ip->i_flags & flags);
235235
}
236236

237237
static inline int
238-
xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
238+
xfs_iflags_test(xfs_inode_t *ip, unsigned long flags)
239239
{
240240
int ret;
241241
spin_lock(&ip->i_flags_lock);
@@ -245,7 +245,7 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
245245
}
246246

247247
static inline int
248-
xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
248+
xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned long flags)
249249
{
250250
int ret;
251251

@@ -258,7 +258,7 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
258258
}
259259

260260
static inline int
261-
xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags)
261+
xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned long flags)
262262
{
263263
int ret;
264264

0 commit comments

Comments
 (0)