Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110052
b: refs/heads/master
c: 3c1370a
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Sep 29, 2008
1 parent 74a1549 commit 11ca345
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 265 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: 4c1eb90a0908c0c60db2169dce08fb672e7582f1
refs/heads/master: 3c1370a3f6ba8e4813269ddbf950d59f997338bc
78 changes: 0 additions & 78 deletions trunk/arch/arm/include/asm/cnt32_to_63.h

This file was deleted.

10 changes: 6 additions & 4 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,10 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
if (dentry->d_parent != parent)
goto next;

/* non-existing due to RCU? */
if (d_unhashed(dentry))
goto next;

/*
* It is safe to compare names since d_move() cannot
* change the qstr (protected by d_lock).
Expand All @@ -1410,10 +1414,8 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
goto next;
}

if (!d_unhashed(dentry)) {
atomic_inc(&dentry->d_count);
found = dentry;
}
atomic_inc(&dentry->d_count);
found = dentry;
spin_unlock(&dentry->d_lock);
break;
next:
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ void dbg_dump_node(const struct ubifs_info *c, const void *node)
printk(KERN_DEBUG "\t%d orphan inode numbers:\n", n);
for (i = 0; i < n; i++)
printk(KERN_DEBUG "\t ino %llu\n",
le64_to_cpu(orph->inos[i]));
(unsigned long long)le64_to_cpu(orph->inos[i]));
break;
}
default:
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)

while (1) {
dbg_gen("feed '%s', ino %llu, new f_pos %#x",
dent->name, le64_to_cpu(dent->inum),
dent->name, (unsigned long long)le64_to_cpu(dent->inum),
key_hash_flash(c, &dent->key));
ubifs_assert(dent->ch.sqnum > ubifs_inode(dir)->creat_sqnum);

Expand Down
1 change: 0 additions & 1 deletion trunk/fs/ubifs/find.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ int ubifs_find_free_space(struct ubifs_info *c, int min_space, int *free,
rsvd_idx_lebs = 0;
lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt -
c->lst.taken_empty_lebs;
ubifs_assert(lebs + c->lst.idx_lebs >= c->min_idx_lebs);
if (rsvd_idx_lebs < lebs)
/*
* OK to allocate an empty LEB, but we still don't want to go
Expand Down
14 changes: 11 additions & 3 deletions trunk/fs/ubifs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp)

err = move_nodes(c, sleb);
if (err)
goto out;
goto out_inc_seq;

err = gc_sync_wbufs(c);
if (err)
goto out;
goto out_inc_seq;

err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, 0, 0);
if (err)
goto out;
goto out_inc_seq;

/* Allow for races with TNC */
c->gced_lnum = lnum;
Expand All @@ -369,6 +369,14 @@ int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp)
out:
ubifs_scan_destroy(sleb);
return err;

out_inc_seq:
/* We may have moved at least some nodes so allow for races with TNC */
c->gced_lnum = lnum;
smp_wmb();
c->gc_seq += 1;
smp_wmb();
goto out;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,14 +1024,13 @@ static int mount_ubifs(struct ubifs_info *c)
goto out_dereg;
}

sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
if (!mounted_read_only) {
err = alloc_wbufs(c);
if (err)
goto out_cbuf;

/* Create background thread */
sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num,
c->vi.vol_id);
c->bgt = kthread_create(ubifs_bg_thread, c, c->bgt_name);
if (!c->bgt)
c->bgt = ERR_PTR(-EINVAL);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ubifs/tnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key,
}

err = fallible_read_node(c, key, &zbr, node);
if (maybe_leb_gced(c, zbr.lnum, gc_seq1)) {
if (err <= 0 || maybe_leb_gced(c, zbr.lnum, gc_seq1)) {
/*
* The node may have been GC'ed out from under us so try again
* while keeping the TNC mutex locked.
Expand Down
94 changes: 3 additions & 91 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4118,7 +4118,7 @@ xfs_iext_indirect_to_direct(
ASSERT(nextents <= XFS_LINEAR_EXTS);
size = nextents * sizeof(xfs_bmbt_rec_t);

xfs_iext_irec_compact_full(ifp);
xfs_iext_irec_compact_pages(ifp);
ASSERT(ifp->if_real_bytes == XFS_IEXT_BUFSZ);

ep = ifp->if_u1.if_ext_irec->er_extbuf;
Expand Down Expand Up @@ -4449,8 +4449,7 @@ xfs_iext_irec_remove(
* compaction policy is as follows:
*
* Full Compaction: Extents fit into a single page (or inline buffer)
* Full Compaction: Extents occupy less than 10% of allocated space
* Partial Compaction: Extents occupy > 10% and < 50% of allocated space
* Partial Compaction: Extents occupy less than 50% of allocated space
* No Compaction: Extents occupy at least 50% of allocated space
*/
void
Expand All @@ -4471,8 +4470,6 @@ xfs_iext_irec_compact(
xfs_iext_direct_to_inline(ifp, nextents);
} else if (nextents <= XFS_LINEAR_EXTS) {
xfs_iext_indirect_to_direct(ifp);
} else if (nextents < (nlists * XFS_LINEAR_EXTS) >> 3) {
xfs_iext_irec_compact_full(ifp);
} else if (nextents < (nlists * XFS_LINEAR_EXTS) >> 1) {
xfs_iext_irec_compact_pages(ifp);
}
Expand All @@ -4496,7 +4493,7 @@ xfs_iext_irec_compact_pages(
erp_next = erp + 1;
if (erp_next->er_extcount <=
(XFS_LINEAR_EXTS - erp->er_extcount)) {
memmove(&erp->er_extbuf[erp->er_extcount],
memcpy(&erp->er_extbuf[erp->er_extcount],
erp_next->er_extbuf, erp_next->er_extcount *
sizeof(xfs_bmbt_rec_t));
erp->er_extcount += erp_next->er_extcount;
Expand All @@ -4515,91 +4512,6 @@ xfs_iext_irec_compact_pages(
}
}

/*
* Fully compact the extent records managed by the indirection array.
*/
void
xfs_iext_irec_compact_full(
xfs_ifork_t *ifp) /* inode fork pointer */
{
xfs_bmbt_rec_host_t *ep, *ep_next; /* extent record pointers */
xfs_ext_irec_t *erp, *erp_next; /* extent irec pointers */
int erp_idx = 0; /* extent irec index */
int ext_avail; /* empty entries in ex list */
int ext_diff; /* number of exts to add */
int nlists; /* number of irec's (ex lists) */

ASSERT(ifp->if_flags & XFS_IFEXTIREC);

nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
erp = ifp->if_u1.if_ext_irec;
ep = &erp->er_extbuf[erp->er_extcount];
erp_next = erp + 1;
ep_next = erp_next->er_extbuf;

while (erp_idx < nlists - 1) {
/*
* Check how many extent records are available in this irec.
* If there is none skip the whole exercise.
*/
ext_avail = XFS_LINEAR_EXTS - erp->er_extcount;
if (ext_avail) {

/*
* Copy over as many as possible extent records into
* the previous page.
*/
ext_diff = MIN(ext_avail, erp_next->er_extcount);
memcpy(ep, ep_next, ext_diff * sizeof(xfs_bmbt_rec_t));
erp->er_extcount += ext_diff;
erp_next->er_extcount -= ext_diff;

/*
* If the next irec is empty now we can simply
* remove it.
*/
if (erp_next->er_extcount == 0) {
/*
* Free page before removing extent record
* so er_extoffs don't get modified in
* xfs_iext_irec_remove.
*/
kmem_free(erp_next->er_extbuf);
erp_next->er_extbuf = NULL;
xfs_iext_irec_remove(ifp, erp_idx + 1);
erp = &ifp->if_u1.if_ext_irec[erp_idx];
nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;

/*
* If the next irec is not empty move up the content
* that has not been copied to the previous page to
* the beggining of this one.
*/
} else {
memmove(erp_next->er_extbuf, &ep_next[ext_diff],
erp_next->er_extcount *
sizeof(xfs_bmbt_rec_t));
ep_next = erp_next->er_extbuf;
memset(&ep_next[erp_next->er_extcount], 0,
(XFS_LINEAR_EXTS -
erp_next->er_extcount) *
sizeof(xfs_bmbt_rec_t));
}
}

if (erp->er_extcount == XFS_LINEAR_EXTS) {
erp_idx++;
if (erp_idx < nlists)
erp = &ifp->if_u1.if_ext_irec[erp_idx];
else
break;
}
ep = &erp->er_extbuf[erp->er_extcount];
erp_next = erp + 1;
ep_next = erp_next->er_extbuf;
}
}

/*
* This is called to update the er_extoff field in the indirection
* array when extents have been added or removed from one of the
Expand Down
Loading

0 comments on commit 11ca345

Please sign in to comment.