Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87998
b: refs/heads/master
c: 0794c66
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Smalley authored and James Morris committed Apr 2, 2008
1 parent 238b2e9 commit f20e6ba
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6be9f7b2835fa442f6b892f174dabc4023c0af2e
refs/heads/master: 0794c66d49885a2f615618ce4940434b5b067d84
2 changes: 1 addition & 1 deletion trunk/block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_addr)
/* Assume anything <= 4GB can be handled by IOMMU.
Actually some IOMMUs can handle everything, but I don't
know of a way to test this here. */
if (b_pfn < (min_t(u64, 0x100000000UL, BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
if (b_pfn <= (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
dma = 1;
q->bounce_pfn = max_low_pfn;
#else
Expand Down
57 changes: 30 additions & 27 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,37 +1143,24 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
}

/*
* Call func for each cic attached to this ioc.
* Call func for each cic attached to this ioc. Returns number of cic's seen.
*/
static void
static unsigned int
call_for_each_cic(struct io_context *ioc,
void (*func)(struct io_context *, struct cfq_io_context *))
{
struct cfq_io_context *cic;
struct hlist_node *n;
int called = 0;

rcu_read_lock();
hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list)
hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list) {
func(ioc, cic);
called++;
}
rcu_read_unlock();
}

static void cfq_cic_free_rcu(struct rcu_head *head)
{
struct cfq_io_context *cic;

cic = container_of(head, struct cfq_io_context, rcu_head);

kmem_cache_free(cfq_ioc_pool, cic);
elv_ioc_count_dec(ioc_count);

if (ioc_gone && !elv_ioc_count_read(ioc_count))
complete(ioc_gone);
}

static void cfq_cic_free(struct cfq_io_context *cic)
{
call_rcu(&cic->rcu_head, cfq_cic_free_rcu);
return called;
}

static void cic_free_func(struct io_context *ioc, struct cfq_io_context *cic)
Expand All @@ -1187,18 +1174,24 @@ static void cic_free_func(struct io_context *ioc, struct cfq_io_context *cic)
hlist_del_rcu(&cic->cic_list);
spin_unlock_irqrestore(&ioc->lock, flags);

cfq_cic_free(cic);
kmem_cache_free(cfq_ioc_pool, cic);
}

static void cfq_free_io_context(struct io_context *ioc)
{
int freed;

/*
* ioc->refcount is zero here, or we are called from elv_unregister(),
* so no more cic's are allowed to be linked into this ioc. So it
* should be ok to iterate over the known list, we will see all cic's
* since no new ones are added.
* ioc->refcount is zero here, so no more cic's are allowed to be
* linked into this ioc. So it should be ok to iterate over the known
* list, we will see all cic's since no new ones are added.
*/
call_for_each_cic(ioc, cic_free_func);
freed = call_for_each_cic(ioc, cic_free_func);

elv_ioc_count_mod(ioc_count, -freed);

if (ioc_gone && !elv_ioc_count_read(ioc_count))
complete(ioc_gone);
}

static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq)
Expand Down Expand Up @@ -1465,6 +1458,15 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct io_context *ioc,
return cfqq;
}

static void cfq_cic_free(struct cfq_io_context *cic)
{
kmem_cache_free(cfq_ioc_pool, cic);
elv_ioc_count_dec(ioc_count);

if (ioc_gone && !elv_ioc_count_read(ioc_count))
complete(ioc_gone);
}

/*
* We drop cfq io contexts lazily, so we may find a dead one.
*/
Expand Down Expand Up @@ -2136,7 +2138,7 @@ static int __init cfq_slab_setup(void)
if (!cfq_pool)
goto fail;

cfq_ioc_pool = KMEM_CACHE(cfq_io_context, 0);
cfq_ioc_pool = KMEM_CACHE(cfq_io_context, SLAB_DESTROY_BY_RCU);
if (!cfq_ioc_pool)
goto fail;

Expand Down Expand Up @@ -2284,6 +2286,7 @@ static void __exit cfq_exit(void)
smp_wmb();
if (elv_ioc_count_read(ioc_count))
wait_for_completion(ioc_gone);
synchronize_rcu();
cfq_slab_kill();
}

Expand Down
17 changes: 8 additions & 9 deletions trunk/crypto/xcbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
struct crypto_xcbc_ctx *ctx = crypto_hash_ctx_aligned(parent);
struct crypto_cipher *tfm = ctx->child;
int bs = crypto_hash_blocksize(parent);
unsigned int i = 0;

for (;;) {
struct page *pg = sg_page(sg);
unsigned int offset = sg->offset;
unsigned int slen = sg->length;
do {

struct page *pg = sg_page(&sg[i]);
unsigned int offset = sg[i].offset;
unsigned int slen = sg[i].length;

if (unlikely(slen > nbytes))
slen = nbytes;
Expand Down Expand Up @@ -180,11 +182,8 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
offset = 0;
pg++;
}

if (!nbytes)
break;
sg = scatterwalk_sg_next(sg);
}
i++;
} while (nbytes>0);

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/afs/cell.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ struct afs_cell *afs_cell_create(const char *name, char *vllist)
cell = afs_cell_alloc(name, vllist);
if (IS_ERR(cell)) {
_leave(" = %ld", PTR_ERR(cell));
up_write(&afs_cells_sem);
return cell;
}

Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/iocontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define IOCONTEXT_H

#include <linux/radix-tree.h>
#include <linux/rcupdate.h>

/*
* This is the per-process anticipatory I/O scheduler state.
Expand Down Expand Up @@ -55,8 +54,6 @@ struct cfq_io_context {

void (*dtor)(struct io_context *); /* destructor */
void (*exit)(struct io_context *); /* called on task exit */

struct rcu_head rcu_head;
};

/*
Expand Down
6 changes: 6 additions & 0 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,12 @@ static inline u32 file_to_av(struct file *file)
else
av |= FILE__WRITE;
}
if (!av) {
/*
* Special file opened with flags 3 for ioctl-only use.
*/
av = FILE__IOCTL;
}

return av;
}
Expand Down

0 comments on commit f20e6ba

Please sign in to comment.