Commit 745b1f47fc0c68dbb1ff440eec8889f61e57194b

Authored by Nathan Scott
Committed by Tim Shimmin
1 parent a3c6685eaa

[XFS] Remove last bulkstat false-positives with debug kernels.

SGI-PV: 953819
SGI-Modid: xfs-linux-melb:xfs-kern:26628a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>

Showing 5 changed files with 22 additions and 17 deletions Side-by-side Diff

... ... @@ -1195,6 +1195,7 @@
1195 1195 "(0x%llx)",
1196 1196 ino, XFS_AGINO_TO_INO(mp, agno, agino));
1197 1197 }
  1198 + xfs_stack_trace();
1198 1199 #endif /* DEBUG */
1199 1200 return XFS_ERROR(EINVAL);
1200 1201 }
... ... @@ -290,11 +290,11 @@
290 290  
291 291 finish_inode:
292 292 if (ip->i_d.di_mode == 0) {
293   - if (!(flags & IGET_CREATE))
  293 + if (!(flags & XFS_IGET_CREATE))
294 294 return ENOENT;
295 295 xfs_iocore_inode_reinit(ip);
296 296 }
297   -
  297 +
298 298 if (lock_flags != 0)
299 299 xfs_ilock(ip, lock_flags);
300 300  
301 301  
302 302  
303 303  
... ... @@ -320,21 +320,20 @@
320 320 * Read the disk inode attributes into a new inode structure and get
321 321 * a new vnode for it. This should also initialize i_ino and i_mount.
322 322 */
323   - error = xfs_iread(mp, tp, ino, &ip, bno);
324   - if (error) {
  323 + error = xfs_iread(mp, tp, ino, &ip, bno,
  324 + (flags & XFS_IGET_BULKSTAT) ? XFS_IMAP_BULKSTAT : 0);
  325 + if (error)
325 326 return error;
326   - }
327 327  
328 328 vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address);
329 329  
330 330 xfs_inode_lock_init(ip, vp);
331 331 xfs_iocore_inode_init(ip);
332 332  
333   - if (lock_flags != 0) {
  333 + if (lock_flags)
334 334 xfs_ilock(ip, lock_flags);
335   - }
336   -
337   - if ((ip->i_d.di_mode == 0) && !(flags & IGET_CREATE)) {
  335 +
  336 + if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) {
338 337 xfs_idestroy(ip);
339 338 return ENOENT;
340 339 }
... ... @@ -854,7 +854,8 @@
854 854 xfs_trans_t *tp,
855 855 xfs_ino_t ino,
856 856 xfs_inode_t **ipp,
857   - xfs_daddr_t bno)
  857 + xfs_daddr_t bno,
  858 + uint imap_flags)
858 859 {
859 860 xfs_buf_t *bp;
860 861 xfs_dinode_t *dip;
... ... @@ -874,7 +875,7 @@
874 875 * return NULL as well. Set i_blkno to 0 so that xfs_itobp() will
875 876 * know that this is a new incore inode.
876 877 */
877   - error = xfs_itobp(mp, tp, ip, &dip, &bp, bno, 0);
  878 + error = xfs_itobp(mp, tp, ip, &dip, &bp, bno, imap_flags);
878 879 if (error) {
879 880 kmem_zone_free(xfs_inode_zone, ip);
880 881 return error;
... ... @@ -1113,7 +1114,7 @@
1113 1114 * to prevent others from looking at until we're done.
1114 1115 */
1115 1116 error = xfs_trans_iget(tp->t_mountp, tp, ino,
1116   - IGET_CREATE, XFS_ILOCK_EXCL, &ip);
  1117 + XFS_IGET_CREATE, XFS_ILOCK_EXCL, &ip);
1117 1118 if (error != 0) {
1118 1119 return error;
1119 1120 }
... ... @@ -389,11 +389,14 @@
389 389 (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID))
390 390  
391 391 /*
392   - * xfs_iget.c prototypes.
  392 + * Flags for xfs_iget()
393 393 */
  394 +#define XFS_IGET_CREATE 0x1
  395 +#define XFS_IGET_BULKSTAT 0x2
394 396  
395   -#define IGET_CREATE 1
396   -
  397 +/*
  398 + * xfs_iget.c prototypes.
  399 + */
397 400 void xfs_ihash_init(struct xfs_mount *);
398 401 void xfs_ihash_free(struct xfs_mount *);
399 402 void xfs_chash_init(struct xfs_mount *);
... ... @@ -425,7 +428,7 @@
425 428 xfs_inode_t *, xfs_dinode_t **, struct xfs_buf **,
426 429 xfs_daddr_t, uint);
427 430 int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
428   - xfs_inode_t **, xfs_daddr_t);
  431 + xfs_inode_t **, xfs_daddr_t, uint);
429 432 int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int);
430 433 int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t,
431 434 xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t,
... ... @@ -52,7 +52,8 @@
52 52 bhv_vnode_t *vp;
53 53 int error;
54 54  
55   - error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, bno);
  55 + error = xfs_iget(mp, NULL, ino,
  56 + XFS_IGET_BULKSTAT, XFS_ILOCK_SHARED, &ip, bno);
56 57 if (error) {
57 58 *stat = BULKSTAT_RV_NOTHING;
58 59 return error;