diff options
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_iget.c | 17 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.h | 11 | ||||
-rw-r--r-- | fs/xfs/xfs_itable.c | 3 |
5 files changed, 22 insertions, 17 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 76813d608dea..a446e5a115c6 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -1195,6 +1195,7 @@ xfs_dilocate( | |||
1195 | "(0x%llx)", | 1195 | "(0x%llx)", |
1196 | ino, XFS_AGINO_TO_INO(mp, agno, agino)); | 1196 | ino, XFS_AGINO_TO_INO(mp, agno, agino)); |
1197 | } | 1197 | } |
1198 | xfs_stack_trace(); | ||
1198 | #endif /* DEBUG */ | 1199 | #endif /* DEBUG */ |
1199 | return XFS_ERROR(EINVAL); | 1200 | return XFS_ERROR(EINVAL); |
1200 | } | 1201 | } |
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 0724df7fabb7..109000a4bc87 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c | |||
@@ -290,11 +290,11 @@ again: | |||
290 | 290 | ||
291 | finish_inode: | 291 | finish_inode: |
292 | if (ip->i_d.di_mode == 0) { | 292 | if (ip->i_d.di_mode == 0) { |
293 | if (!(flags & IGET_CREATE)) | 293 | if (!(flags & XFS_IGET_CREATE)) |
294 | return ENOENT; | 294 | return ENOENT; |
295 | xfs_iocore_inode_reinit(ip); | 295 | xfs_iocore_inode_reinit(ip); |
296 | } | 296 | } |
297 | 297 | ||
298 | if (lock_flags != 0) | 298 | if (lock_flags != 0) |
299 | xfs_ilock(ip, lock_flags); | 299 | xfs_ilock(ip, lock_flags); |
300 | 300 | ||
@@ -320,21 +320,20 @@ finish_inode: | |||
320 | * Read the disk inode attributes into a new inode structure and get | 320 | * Read the disk inode attributes into a new inode structure and get |
321 | * a new vnode for it. This should also initialize i_ino and i_mount. | 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); | 323 | error = xfs_iread(mp, tp, ino, &ip, bno, |
324 | if (error) { | 324 | (flags & XFS_IGET_BULKSTAT) ? XFS_IMAP_BULKSTAT : 0); |
325 | if (error) | ||
325 | return error; | 326 | return error; |
326 | } | ||
327 | 327 | ||
328 | vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address); | 328 | vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address); |
329 | 329 | ||
330 | xfs_inode_lock_init(ip, vp); | 330 | xfs_inode_lock_init(ip, vp); |
331 | xfs_iocore_inode_init(ip); | 331 | xfs_iocore_inode_init(ip); |
332 | 332 | ||
333 | if (lock_flags != 0) { | 333 | if (lock_flags) |
334 | xfs_ilock(ip, lock_flags); | 334 | xfs_ilock(ip, lock_flags); |
335 | } | 335 | |
336 | 336 | if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { | |
337 | if ((ip->i_d.di_mode == 0) && !(flags & IGET_CREATE)) { | ||
338 | xfs_idestroy(ip); | 337 | xfs_idestroy(ip); |
339 | return ENOENT; | 338 | return ENOENT; |
340 | } | 339 | } |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 1f8ecff8553a..66a78287a957 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -854,7 +854,8 @@ xfs_iread( | |||
854 | xfs_trans_t *tp, | 854 | xfs_trans_t *tp, |
855 | xfs_ino_t ino, | 855 | xfs_ino_t ino, |
856 | xfs_inode_t **ipp, | 856 | xfs_inode_t **ipp, |
857 | xfs_daddr_t bno) | 857 | xfs_daddr_t bno, |
858 | uint imap_flags) | ||
858 | { | 859 | { |
859 | xfs_buf_t *bp; | 860 | xfs_buf_t *bp; |
860 | xfs_dinode_t *dip; | 861 | xfs_dinode_t *dip; |
@@ -874,7 +875,7 @@ xfs_iread( | |||
874 | * return NULL as well. Set i_blkno to 0 so that xfs_itobp() will | 875 | * return NULL as well. Set i_blkno to 0 so that xfs_itobp() will |
875 | * know that this is a new incore inode. | 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 | if (error) { | 879 | if (error) { |
879 | kmem_zone_free(xfs_inode_zone, ip); | 880 | kmem_zone_free(xfs_inode_zone, ip); |
880 | return error; | 881 | return error; |
@@ -1113,7 +1114,7 @@ xfs_ialloc( | |||
1113 | * to prevent others from looking at until we're done. | 1114 | * to prevent others from looking at until we're done. |
1114 | */ | 1115 | */ |
1115 | error = xfs_trans_iget(tp->t_mountp, tp, ino, | 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 | if (error != 0) { | 1118 | if (error != 0) { |
1118 | return error; | 1119 | return error; |
1119 | } | 1120 | } |
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index d10b76ed1e5b..fdb89f72db95 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -389,11 +389,14 @@ typedef struct xfs_inode { | |||
389 | (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID)) | 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 | 397 | /* |
396 | 398 | * xfs_iget.c prototypes. | |
399 | */ | ||
397 | void xfs_ihash_init(struct xfs_mount *); | 400 | void xfs_ihash_init(struct xfs_mount *); |
398 | void xfs_ihash_free(struct xfs_mount *); | 401 | void xfs_ihash_free(struct xfs_mount *); |
399 | void xfs_chash_init(struct xfs_mount *); | 402 | void xfs_chash_init(struct xfs_mount *); |
@@ -425,7 +428,7 @@ int xfs_itobp(struct xfs_mount *, struct xfs_trans *, | |||
425 | xfs_inode_t *, xfs_dinode_t **, struct xfs_buf **, | 428 | xfs_inode_t *, xfs_dinode_t **, struct xfs_buf **, |
426 | xfs_daddr_t, uint); | 429 | xfs_daddr_t, uint); |
427 | int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, | 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 | int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); | 432 | int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); |
430 | int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, | 433 | int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, |
431 | xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, | 434 | xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 315c9bcd3be3..612689940659 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -52,7 +52,8 @@ xfs_bulkstat_one_iget( | |||
52 | bhv_vnode_t *vp; | 52 | bhv_vnode_t *vp; |
53 | int error; | 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 | if (error) { | 57 | if (error) { |
57 | *stat = BULKSTAT_RV_NOTHING; | 58 | *stat = BULKSTAT_RV_NOTHING; |
58 | return error; | 59 | return error; |