Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commitae1a25d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (37 commits) Btrfs: Make sure dir is non-null before doing S_ISGID checks Btrfs: Fix memory leak in cache_drop_leaf_ref Btrfs: don't return congestion in write_cache_pages as often Btrfs: Only prep for btree deletion balances when nodes are mostly empty Btrfs: fix btrfs_unlock_up_safe to walk the entire path Btrfs: change btrfs_del_leaf to drop locks earlier Btrfs: Change btrfs_truncate_inode_items to stop when it hits the inode Btrfs: Don't try to compress pages past i_size Btrfs: join the transaction in __btrfs_setxattr Btrfs: Handle SGID bit when creating inodes Btrfs: Make btrfs_drop_snapshot work in larger and more efficient chunks Btrfs: Change btree locking to use explicit blocking points Btrfs: hash_lock is no longer needed Btrfs: disable leak debugging checks in extent_io.c Btrfs: sort references by byte number during btrfs_inc_ref Btrfs: async threads should try harder to find work Btrfs: selinux support Btrfs: make btrfs acls selectable Btrfs: Catch missed bios in the async bio submission thread Btrfs: fix readdir on 32 bit machines ...
2 parentsfd9fc84 +42f15d7 commitae1a25d

27 files changed

+1421
-451
lines changed

‎MAINTAINERS‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,14 @@ M:mb@bu3sch.de
10211021
W:http://bu3sch.de/btgpio.php
10221022
S:Maintained
10231023

1024+
BTRFS FILE SYSTEM
1025+
P:Chris Mason
1026+
M:chris.mason@oracle.com
1027+
L:linux-btrfs@vger.kernel.org
1028+
W:http://btrfs.wiki.kernel.org/
1029+
T:git kernel.org:/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
1030+
S:Maintained
1031+
10241032
BTTV VIDEO4LINUX DRIVER
10251033
P:Mauro Carvalho Chehab
10261034
M:mchehab@infradead.org

‎fs/btrfs/Kconfig‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,16 @@ config BTRFS_FS
1616
module will be called btrfs.
1717

1818
If unsure, say N.
19+
20+
config BTRFS_FS_POSIX_ACL
21+
bool "Btrfs POSIX Access Control Lists"
22+
depends on BTRFS_FS
23+
select FS_POSIX_ACL
24+
help
25+
POSIX Access Control Lists (ACLs) support permissions for users and
26+
groups beyond the owner/group/world scheme.
27+
28+
To learn more about Access Control Lists, visit the POSIX ACLs for
29+
Linux website <http://acl.bestbits.at/>.
30+
31+
If you don't know what Access Control Lists are, say N

‎fs/btrfs/async-thread.c‎

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* Boston, MA 021110-1307, USA.
1717
*/
1818

19-
#include<linux/version.h>
2019
#include<linux/kthread.h>
2120
#include<linux/list.h>
2221
#include<linux/spinlock.h>
23-
# include<linux/freezer.h>
22+
#include<linux/freezer.h>
23+
#include<linux/ftrace.h>
2424
#include"async-thread.h"
2525

2626
#defineWORK_QUEUED_BIT 0
@@ -143,6 +143,7 @@ static int worker_loop(void *arg)
143143
structbtrfs_work*work;
144144
do {
145145
spin_lock_irq(&worker->lock);
146+
again_locked:
146147
while (!list_empty(&worker->pending)) {
147148
cur=worker->pending.next;
148149
work=list_entry(cur,structbtrfs_work,list);
@@ -165,14 +166,50 @@ static int worker_loop(void *arg)
165166
check_idle_worker(worker);
166167

167168
}
168-
worker->working=0;
169169
if (freezing(current)) {
170+
worker->working=0;
171+
spin_unlock_irq(&worker->lock);
170172
refrigerator();
171173
}else {
172-
set_current_state(TASK_INTERRUPTIBLE);
173174
spin_unlock_irq(&worker->lock);
174-
if (!kthread_should_stop())
175+
if (!kthread_should_stop()) {
176+
cpu_relax();
177+
/*
178+
* we've dropped the lock, did someone else
179+
* jump_in?
180+
*/
181+
smp_mb();
182+
if (!list_empty(&worker->pending))
183+
continue;
184+
185+
/*
186+
* this short schedule allows more work to
187+
* come in without the queue functions
188+
* needing to go through wake_up_process()
189+
*
190+
* worker->working is still 1, so nobody
191+
* is going to try and wake us up
192+
*/
193+
schedule_timeout(1);
194+
smp_mb();
195+
if (!list_empty(&worker->pending))
196+
continue;
197+
198+
/* still no more work?, sleep for real */
199+
spin_lock_irq(&worker->lock);
200+
set_current_state(TASK_INTERRUPTIBLE);
201+
if (!list_empty(&worker->pending))
202+
gotoagain_locked;
203+
204+
/*
205+
* this makes sure we get a wakeup when someone
206+
* adds something new to the queue
207+
*/
208+
worker->working=0;
209+
spin_unlock_irq(&worker->lock);
210+
175211
schedule();
212+
}
176213
__set_current_state(TASK_RUNNING);
177214
}
178215
}while (!kthread_should_stop());
@@ -350,13 +387,14 @@ int btrfs_requeue_work(struct btrfs_work *work)
350387
{
351388
structbtrfs_worker_thread*worker=work->worker;
352389
unsigned longflags;
390+
intwake=0;
353391

354392
if (test_and_set_bit(WORK_QUEUED_BIT,&work->flags))
355393
gotoout;
356394

357395
spin_lock_irqsave(&worker->lock,flags);
358-
atomic_inc(&worker->num_pending);
359396
list_add_tail(&work->list,&worker->pending);
397+
atomic_inc(&worker->num_pending);
360398

361399
/* by definition we're busy, take ourselves off the idle
362400
* list
@@ -368,10 +406,16 @@ int btrfs_requeue_work(struct btrfs_work *work)
368406
&worker->workers->worker_list);
369407
spin_unlock_irqrestore(&worker->workers->lock,flags);
370408
}
409+
if (!worker->working) {
410+
wake=1;
411+
worker->working=1;
412+
}
371413

372414
spin_unlock_irqrestore(&worker->lock,flags);
373-
415+
if (wake)
416+
wake_up_process(worker->task);
374417
out:
418+
375419
return0;
376420
}
377421

@@ -398,9 +442,10 @@ int btrfs_queue_worker(struct btrfs_workers *workers, struct btrfs_work *work)
398442
}
399443

400444
spin_lock_irqsave(&worker->lock,flags);
445+
446+
list_add_tail(&work->list,&worker->pending);
401447
atomic_inc(&worker->num_pending);
402448
check_busy_worker(worker);
403-
list_add_tail(&work->list,&worker->pending);
404449

405450
/*
406451
* avoid calling into wake_up_process if this thread has already

‎fs/btrfs/compression.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include<linux/swap.h>
3333
#include<linux/writeback.h>
3434
#include<linux/bit_spinlock.h>
35-
#include<linux/version.h>
3635
#include<linux/pagevec.h>
3736
#include"compat.h"
3837
#include"ctree.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp