Skip to content

Commit 1e05ff0

Browse files
committed
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: use proper interfaces for on-stack plugging xfs: fix xfs_debug warnings xfs: fix variable set but not used warnings xfs: convert log tail checking to a warning xfs: catch bad block numbers freeing extents. xfs: push the AIL from memory reclaim and periodic sync xfs: clean up code layout in xfs_trans_ail.c xfs: convert the xfsaild threads to a workqueue xfs: introduce background inode reclaim work xfs: convert ENOSPC inode flushing to use new syncd workqueue xfs: introduce a xfssyncd workqueue xfs: fix extent format buffer allocation size xfs: fix unreferenced var error in xfs_buf.c Also, applied patch from Tony Luck that fixes ia64: xfs_destroy_workqueues() should not be tagged with__exit in the branch before merging.
2 parents a97b520 + 39411f8 commit 1e05ff0

17 files changed

+531
-507
lines changed

fs/xfs/linux-2.6/xfs_buf.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ xfs_buf_allocate_memory(
293293
size_t nbytes, offset;
294294
gfp_t gfp_mask = xb_to_gfp(flags);
295295
unsigned short page_count, i;
296-
pgoff_t first;
297296
xfs_off_t end;
298297
int error;
299298

@@ -333,7 +332,6 @@ xfs_buf_allocate_memory(
333332
return error;
334333

335334
offset = bp->b_offset;
336-
first = bp->b_file_offset >> PAGE_SHIFT;
337335
bp->b_flags |= _XBF_PAGES;
338336

339337
for (i = 0; i < bp->b_page_count; i++) {
@@ -657,8 +655,6 @@ xfs_buf_readahead(
657655
xfs_off_t ioff,
658656
size_t isize)
659657
{
660-
struct backing_dev_info *bdi;
661-
662658
if (bdi_read_congested(target->bt_bdi))
663659
return;
664660

@@ -919,8 +915,6 @@ xfs_buf_lock(
919915

920916
if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE))
921917
xfs_log_force(bp->b_target->bt_mount, 0);
922-
if (atomic_read(&bp->b_io_remaining))
923-
blk_flush_plug(current);
924918
down(&bp->b_sema);
925919
XB_SET_OWNER(bp);
926920

@@ -1309,8 +1303,6 @@ xfs_buf_iowait(
13091303
{
13101304
trace_xfs_buf_iowait(bp, _RET_IP_);
13111305

1312-
if (atomic_read(&bp->b_io_remaining))
1313-
blk_flush_plug(current);
13141306
wait_for_completion(&bp->b_iowait);
13151307

13161308
trace_xfs_buf_iowait_done(bp, _RET_IP_);
@@ -1747,8 +1739,8 @@ xfsbufd(
17471739
do {
17481740
long age = xfs_buf_age_centisecs * msecs_to_jiffies(10);
17491741
long tout = xfs_buf_timer_centisecs * msecs_to_jiffies(10);
1750-
int count = 0;
17511742
struct list_head tmp;
1743+
struct blk_plug plug;
17521744

17531745
if (unlikely(freezing(current))) {
17541746
set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
@@ -1764,16 +1756,15 @@ xfsbufd(
17641756

17651757
xfs_buf_delwri_split(target, &tmp, age);
17661758
list_sort(NULL, &tmp, xfs_buf_cmp);
1759+
1760+
blk_start_plug(&plug);
17671761
while (!list_empty(&tmp)) {
17681762
struct xfs_buf *bp;
17691763
bp = list_first_entry(&tmp, struct xfs_buf, b_list);
17701764
list_del_init(&bp->b_list);
17711765
xfs_bdstrat_cb(bp);
1772-
count++;
17731766
}
1774-
if (count)
1775-
blk_flush_plug(current);
1776-
1767+
blk_finish_plug(&plug);
17771768
} while (!kthread_should_stop());
17781769

17791770
return 0;
@@ -1793,6 +1784,7 @@ xfs_flush_buftarg(
17931784
int pincount = 0;
17941785
LIST_HEAD(tmp_list);
17951786
LIST_HEAD(wait_list);
1787+
struct blk_plug plug;
17961788

17971789
xfs_buf_runall_queues(xfsconvertd_workqueue);
17981790
xfs_buf_runall_queues(xfsdatad_workqueue);
@@ -1807,6 +1799,8 @@ xfs_flush_buftarg(
18071799
* we do that after issuing all the IO.
18081800
*/
18091801
list_sort(NULL, &tmp_list, xfs_buf_cmp);
1802+
1803+
blk_start_plug(&plug);
18101804
while (!list_empty(&tmp_list)) {
18111805
bp = list_first_entry(&tmp_list, struct xfs_buf, b_list);
18121806
ASSERT(target == bp->b_target);
@@ -1817,10 +1811,10 @@ xfs_flush_buftarg(
18171811
}
18181812
xfs_bdstrat_cb(bp);
18191813
}
1814+
blk_finish_plug(&plug);
18201815

18211816
if (wait) {
1822-
/* Expedite and wait for IO to complete. */
1823-
blk_flush_plug(current);
1817+
/* Wait for IO to complete. */
18241818
while (!list_empty(&wait_list)) {
18251819
bp = list_first_entry(&wait_list, struct xfs_buf, b_list);
18261820

fs/xfs/linux-2.6/xfs_message.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,53 +28,47 @@
2828
/*
2929
* XFS logging functions
3030
*/
31-
static int
31+
static void
3232
__xfs_printk(
3333
const char *level,
3434
const struct xfs_mount *mp,
3535
struct va_format *vaf)
3636
{
3737
if (mp && mp->m_fsname)
38-
return printk("%sXFS (%s): %pV\n", level, mp->m_fsname, vaf);
39-
return printk("%sXFS: %pV\n", level, vaf);
38+
printk("%sXFS (%s): %pV\n", level, mp->m_fsname, vaf);
39+
printk("%sXFS: %pV\n", level, vaf);
4040
}
4141

42-
int xfs_printk(
42+
void xfs_printk(
4343
const char *level,
4444
const struct xfs_mount *mp,
4545
const char *fmt, ...)
4646
{
4747
struct va_format vaf;
4848
va_list args;
49-
int r;
5049

5150
va_start(args, fmt);
5251

5352
vaf.fmt = fmt;
5453
vaf.va = &args;
5554

56-
r = __xfs_printk(level, mp, &vaf);
55+
__xfs_printk(level, mp, &vaf);
5756
va_end(args);
58-
59-
return r;
6057
}
6158

6259
#define define_xfs_printk_level(func, kern_level) \
63-
int func(const struct xfs_mount *mp, const char *fmt, ...) \
60+
void func(const struct xfs_mount *mp, const char *fmt, ...) \
6461
{ \
6562
struct va_format vaf; \
6663
va_list args; \
67-
int r; \
6864
\
6965
va_start(args, fmt); \
7066
\
7167
vaf.fmt = fmt; \
7268
vaf.va = &args; \
7369
\
74-
r = __xfs_printk(kern_level, mp, &vaf); \
70+
__xfs_printk(kern_level, mp, &vaf); \
7571
va_end(args); \
76-
\
77-
return r; \
7872
} \
7973

8074
define_xfs_printk_level(xfs_emerg, KERN_EMERG);
@@ -88,7 +82,7 @@ define_xfs_printk_level(xfs_info, KERN_INFO);
8882
define_xfs_printk_level(xfs_debug, KERN_DEBUG);
8983
#endif
9084

91-
int
85+
void
9286
xfs_alert_tag(
9387
const struct xfs_mount *mp,
9488
int panic_tag,
@@ -97,7 +91,6 @@ xfs_alert_tag(
9791
struct va_format vaf;
9892
va_list args;
9993
int do_panic = 0;
100-
int r;
10194

10295
if (xfs_panic_mask && (xfs_panic_mask & panic_tag)) {
10396
xfs_printk(KERN_ALERT, mp,
@@ -110,12 +103,10 @@ xfs_alert_tag(
110103
vaf.fmt = fmt;
111104
vaf.va = &args;
112105

113-
r = __xfs_printk(KERN_ALERT, mp, &vaf);
106+
__xfs_printk(KERN_ALERT, mp, &vaf);
114107
va_end(args);
115108

116109
BUG_ON(do_panic);
117-
118-
return r;
119110
}
120111

121112
void

fs/xfs/linux-2.6/xfs_message.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@
33

44
struct xfs_mount;
55

6-
extern int xfs_printk(const char *level, const struct xfs_mount *mp,
6+
extern void xfs_printk(const char *level, const struct xfs_mount *mp,
77
const char *fmt, ...)
88
__attribute__ ((format (printf, 3, 4)));
9-
extern int xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...)
9+
extern void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...)
1010
__attribute__ ((format (printf, 2, 3)));
11-
extern int xfs_alert(const struct xfs_mount *mp, const char *fmt, ...)
11+
extern void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...)
1212
__attribute__ ((format (printf, 2, 3)));
13-
extern int xfs_alert_tag(const struct xfs_mount *mp, int tag,
13+
extern void xfs_alert_tag(const struct xfs_mount *mp, int tag,
1414
const char *fmt, ...)
1515
__attribute__ ((format (printf, 3, 4)));
16-
extern int xfs_crit(const struct xfs_mount *mp, const char *fmt, ...)
16+
extern void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...)
1717
__attribute__ ((format (printf, 2, 3)));
18-
extern int xfs_err(const struct xfs_mount *mp, const char *fmt, ...)
18+
extern void xfs_err(const struct xfs_mount *mp, const char *fmt, ...)
1919
__attribute__ ((format (printf, 2, 3)));
20-
extern int xfs_warn(const struct xfs_mount *mp, const char *fmt, ...)
20+
extern void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...)
2121
__attribute__ ((format (printf, 2, 3)));
22-
extern int xfs_notice(const struct xfs_mount *mp, const char *fmt, ...)
22+
extern void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...)
2323
__attribute__ ((format (printf, 2, 3)));
24-
extern int xfs_info(const struct xfs_mount *mp, const char *fmt, ...)
24+
extern void xfs_info(const struct xfs_mount *mp, const char *fmt, ...)
2525
__attribute__ ((format (printf, 2, 3)));
2626

2727
#ifdef DEBUG
28-
extern int xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
28+
extern void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
2929
__attribute__ ((format (printf, 2, 3)));
3030
#else
31-
#define xfs_debug(mp, fmt, ...) (0)
31+
static inline void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
32+
{
33+
}
3234
#endif
3335

3436
extern void assfail(char *expr, char *f, int l);

0 commit comments

Comments
 (0)