Loading fs/xfs/xfs_alloc.c +8 −11 Original line number Diff line number Diff line Loading @@ -257,16 +257,14 @@ xfs_alloc_fix_len( k = rlen % args->prod; if (k == args->mod) return; if (k > args->mod) { if ((int)(rlen = rlen - k - args->mod) < (int)args->minlen) return; } else { if ((int)(rlen = rlen - args->prod - (args->mod - k)) < (int)args->minlen) if (k > args->mod) rlen = rlen - (k - args->mod); else rlen = rlen - args->prod + (args->mod - k); if ((int)rlen < (int)args->minlen) return; } ASSERT(rlen >= args->minlen); ASSERT(rlen <= args->maxlen); ASSERT(rlen >= args->minlen && rlen <= args->maxlen); ASSERT(rlen % args->prod == args->mod); args->len = rlen; } Loading Loading @@ -541,7 +539,6 @@ xfs_alloc_read_agfl( XFS_FSS_TO_BB(mp, 1), 0, &bp, &xfs_agfl_buf_ops); if (error) return error; ASSERT(!xfs_buf_geterror(bp)); xfs_buf_set_ref(bp, XFS_AGFL_REF); *bpp = bp; return 0; Loading fs/xfs/xfs_aops.c +3 −3 Original line number Diff line number Diff line Loading @@ -975,7 +975,7 @@ xfs_vm_writepage( * Given that we do not allow direct reclaim to call us, we should * never be called while in a filesystem transaction. */ if (WARN_ON(current->flags & PF_FSTRANS)) if (WARN_ON_ONCE(current->flags & PF_FSTRANS)) goto redirty; /* Is this page beyond the end of the file? */ Loading Loading @@ -1225,9 +1225,9 @@ xfs_vm_releasepage( xfs_count_page_state(page, &delalloc, &unwritten); if (WARN_ON(delalloc)) if (WARN_ON_ONCE(delalloc)) return 0; if (WARN_ON(unwritten)) if (WARN_ON_ONCE(unwritten)) return 0; return try_to_free_buffers(page); Loading fs/xfs/xfs_bit.h +5 −2 Original line number Diff line number Diff line Loading @@ -66,9 +66,12 @@ static inline int xfs_lowbit64(__uint64_t v) n = ffs(w); } else { /* upper bits */ w = (__uint32_t)(v >> 32); if (w && (n = ffs(w))) if (w) { n = ffs(w); if (n) n += 32; } } return n - 1; } Loading fs/xfs/xfs_bmap_util.c +13 −3 Original line number Diff line number Diff line Loading @@ -258,14 +258,23 @@ xfs_bmapi_allocate_worker( struct xfs_bmalloca *args = container_of(work, struct xfs_bmalloca, work); unsigned long pflags; unsigned long new_pflags = PF_FSTRANS; /* we are in a transaction context here */ current_set_flags_nested(&pflags, PF_FSTRANS); /* * we are in a transaction context here, but may also be doing work * in kswapd context, and hence we may need to inherit that state * temporarily to ensure that we don't block waiting for memory reclaim * in any way. */ if (args->kswapd) new_pflags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD; current_set_flags_nested(&pflags, new_pflags); args->result = __xfs_bmapi_allocate(args); complete(args->done); current_restore_flags_nested(&pflags, PF_FSTRANS); current_restore_flags_nested(&pflags, new_pflags); } /* Loading @@ -284,6 +293,7 @@ xfs_bmapi_allocate( args->done = &done; args->kswapd = current_is_kswapd(); INIT_WORK_ONSTACK(&args->work, xfs_bmapi_allocate_worker); queue_work(xfs_alloc_wq, &args->work); wait_for_completion(&done); Loading fs/xfs/xfs_bmap_util.h +7 −6 Original line number Diff line number Diff line Loading @@ -50,12 +50,13 @@ struct xfs_bmalloca { xfs_extlen_t total; /* total blocks needed for xaction */ xfs_extlen_t minlen; /* minimum allocation size (blocks) */ xfs_extlen_t minleft; /* amount must be left after alloc */ char eof; /* set if allocating past last extent */ char wasdel; /* replacing a delayed allocation */ char userdata;/* set if is user data */ char aeof; /* allocated space at eof */ char conv; /* overwriting unwritten extents */ char stack_switch; bool eof; /* set if allocating past last extent */ bool wasdel; /* replacing a delayed allocation */ bool userdata;/* set if is user data */ bool aeof; /* allocated space at eof */ bool conv; /* overwriting unwritten extents */ bool stack_switch; bool kswapd; /* allocation in kswapd context */ int flags; struct completion *done; struct work_struct work; Loading Loading
fs/xfs/xfs_alloc.c +8 −11 Original line number Diff line number Diff line Loading @@ -257,16 +257,14 @@ xfs_alloc_fix_len( k = rlen % args->prod; if (k == args->mod) return; if (k > args->mod) { if ((int)(rlen = rlen - k - args->mod) < (int)args->minlen) return; } else { if ((int)(rlen = rlen - args->prod - (args->mod - k)) < (int)args->minlen) if (k > args->mod) rlen = rlen - (k - args->mod); else rlen = rlen - args->prod + (args->mod - k); if ((int)rlen < (int)args->minlen) return; } ASSERT(rlen >= args->minlen); ASSERT(rlen <= args->maxlen); ASSERT(rlen >= args->minlen && rlen <= args->maxlen); ASSERT(rlen % args->prod == args->mod); args->len = rlen; } Loading Loading @@ -541,7 +539,6 @@ xfs_alloc_read_agfl( XFS_FSS_TO_BB(mp, 1), 0, &bp, &xfs_agfl_buf_ops); if (error) return error; ASSERT(!xfs_buf_geterror(bp)); xfs_buf_set_ref(bp, XFS_AGFL_REF); *bpp = bp; return 0; Loading
fs/xfs/xfs_aops.c +3 −3 Original line number Diff line number Diff line Loading @@ -975,7 +975,7 @@ xfs_vm_writepage( * Given that we do not allow direct reclaim to call us, we should * never be called while in a filesystem transaction. */ if (WARN_ON(current->flags & PF_FSTRANS)) if (WARN_ON_ONCE(current->flags & PF_FSTRANS)) goto redirty; /* Is this page beyond the end of the file? */ Loading Loading @@ -1225,9 +1225,9 @@ xfs_vm_releasepage( xfs_count_page_state(page, &delalloc, &unwritten); if (WARN_ON(delalloc)) if (WARN_ON_ONCE(delalloc)) return 0; if (WARN_ON(unwritten)) if (WARN_ON_ONCE(unwritten)) return 0; return try_to_free_buffers(page); Loading
fs/xfs/xfs_bit.h +5 −2 Original line number Diff line number Diff line Loading @@ -66,9 +66,12 @@ static inline int xfs_lowbit64(__uint64_t v) n = ffs(w); } else { /* upper bits */ w = (__uint32_t)(v >> 32); if (w && (n = ffs(w))) if (w) { n = ffs(w); if (n) n += 32; } } return n - 1; } Loading
fs/xfs/xfs_bmap_util.c +13 −3 Original line number Diff line number Diff line Loading @@ -258,14 +258,23 @@ xfs_bmapi_allocate_worker( struct xfs_bmalloca *args = container_of(work, struct xfs_bmalloca, work); unsigned long pflags; unsigned long new_pflags = PF_FSTRANS; /* we are in a transaction context here */ current_set_flags_nested(&pflags, PF_FSTRANS); /* * we are in a transaction context here, but may also be doing work * in kswapd context, and hence we may need to inherit that state * temporarily to ensure that we don't block waiting for memory reclaim * in any way. */ if (args->kswapd) new_pflags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD; current_set_flags_nested(&pflags, new_pflags); args->result = __xfs_bmapi_allocate(args); complete(args->done); current_restore_flags_nested(&pflags, PF_FSTRANS); current_restore_flags_nested(&pflags, new_pflags); } /* Loading @@ -284,6 +293,7 @@ xfs_bmapi_allocate( args->done = &done; args->kswapd = current_is_kswapd(); INIT_WORK_ONSTACK(&args->work, xfs_bmapi_allocate_worker); queue_work(xfs_alloc_wq, &args->work); wait_for_completion(&done); Loading
fs/xfs/xfs_bmap_util.h +7 −6 Original line number Diff line number Diff line Loading @@ -50,12 +50,13 @@ struct xfs_bmalloca { xfs_extlen_t total; /* total blocks needed for xaction */ xfs_extlen_t minlen; /* minimum allocation size (blocks) */ xfs_extlen_t minleft; /* amount must be left after alloc */ char eof; /* set if allocating past last extent */ char wasdel; /* replacing a delayed allocation */ char userdata;/* set if is user data */ char aeof; /* allocated space at eof */ char conv; /* overwriting unwritten extents */ char stack_switch; bool eof; /* set if allocating past last extent */ bool wasdel; /* replacing a delayed allocation */ bool userdata;/* set if is user data */ bool aeof; /* allocated space at eof */ bool conv; /* overwriting unwritten extents */ bool stack_switch; bool kswapd; /* allocation in kswapd context */ int flags; struct completion *done; struct work_struct work; Loading