• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/jfs/

Lines Matching refs:index

37  * each directory page maintains a sorted entry index table
38 * which stores the start slot index of sorted entries
117 s16 index;
185 static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
203 * Reads a page of a directory's index table.
245 * index and pointer to its entry.
249 static struct dir_table_slot *find_index(struct inode *ip, u32 index,
259 if (index < 2) {
261 jfs_warn("find_entry called with index = %d", index);
267 if (index >= jfs_ip->next_index) {
268 jfs_warn("find_entry called with index >= next_index");
277 slot = &jfs_ip->i_dirtable[index - 2];
279 offset = (index - 2) * sizeof(struct dir_table_slot);
305 u32 index)
314 if (llck->index >= llck->maxcnt)
316 lv = &llck->lv[llck->index];
322 lv->offset = ((index - 2) & 511) >> 1;
324 llck->index++;
330 * Adds an entry to the directory index table. This is used to provide
331 * each directory entry with a persistent index in which to resume
341 u32 index;
358 index = jfs_ip->next_index++;
360 if (index <= MAX_INLINE_DIRTABLE_ENTRY) {
362 * i_size reflects size of index table, or 8 bytes per entry.
364 ip->i_size = (loff_t) (index - 1) << 3;
369 dirtab_slot = &jfs_ip->i_dirtable[index-2];
376 return index;
378 if (index == (MAX_INLINE_DIRTABLE_ENTRY + 1)) {
427 ASSERT(llck->index == 0);
432 llck->index++;
445 offset = (index - 2) * sizeof(struct dir_table_slot);
471 lock_index(tid, ip, mp, index);
482 return index;
494 * Marks an entry to the directory index table as free.
496 static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next)
502 dirtab_slot = find_index(ip, index, &mp, &lblock);
512 lock_index(tid, ip, mp, index);
522 * Changes an entry in the directory index table
524 static void modify_index(tid_t tid, struct inode *ip, u32 index, s64 bn,
529 dirtab_slot = find_index(ip, index, mp, lblock);
538 lock_index(tid, ip, *mp, index);
549 static int read_index(struct inode *ip, u32 index,
556 slot = find_index(ip, index, &mp, &lblock);
589 int base, index, lim;
627 * greater than K so that the returned index is the position of
646 index = base + (lim >> 1);
651 ciCompare(&ciKey, p, stbl[index],
656 cmp = dtCompare(&ciKey, p, stbl[index]);
669 ((struct ldtentry *) & p->slot[stbl[index]])->inumber);
706 btsp->index = index;
720 base = index + 1;
728 * base is the smallest index with key (Kj) greater than
729 * search key (K) and may be zero or (maxindex + 1) index.
755 btsp->index = base;
768 index = base ? base - 1 : base;
786 /* push (bn, index) of the parent page/entry */
787 BT_PUSH(btstack, bn, index);
790 pxd = (pxd_t *) & p->slot[stbl[index]];
826 dtpage_t *p; /* base B+-tree index page */
828 int index;
839 * dtSearch() returns (leaf page pinned, index at which to insert).
840 * n.b. dtSearch() may return index of (maxindex + 1) of
843 DT_GETSEARCH(ip, btstack->top, bn, mp, p, index);
871 split.index = index;
890 ASSERT(dtlck->index == 0);
896 dtlck->index++;
898 dtInsertEntry(p, index, name, &data, &dtlck);
902 if (dtlck->index >= dtlck->maxcnt)
904 lv = & dtlck->lv[dtlck->index];
905 n = index >> L2DTSLOTSIZE;
909 dtlck->index++;
942 int skip; /* index of entry of insertion */
1074 * new index page(s) to cover page split(s)
1111 * of (bn of parent page, index of child page entry in parent page)
1146 * The new key entry goes ONE AFTER the index of parent entry,
1149 skip = parent->index + 1;
1235 split->index = skip; /* index at insert */
1267 ASSERT(dtlck->index == 0);
1273 dtlck->index++;
1283 dtlck->index++;
1401 ASSERT(sdtlck->index == 0);
1405 sdtlck->index++;
1446 if (nextbn == 0 && split->index == sp->header.nextindex) {
1448 rlv = & rdtlck->lv[rdtlck->index];
1451 rdtlck->index++;
1491 lv = & dtlck->lv[dtlck->index];
1494 dtlck->index++;
1504 skip = split->index;
1560 rlv = & rdtlck->lv[rdtlck->index];
1563 rdtlck->index++;
1579 * Update directory index table for entries now in right page
1588 modify_index(tid, ip, le32_to_cpu(ldtentry->index),
1596 * the skipped index was on the left page,
1603 if (sdtlck->index >= sdtlck->maxcnt)
1605 slv = & sdtlck->lv[sdtlck->index];
1610 sdtlck->index++;
1613 * the skipped index was on the right page,
1616 /* adjust the skip index to reflect the new position */
1700 pxdlock->index = 1;
1703 * Update directory index table to reflect new page address
1714 le32_to_cpu(ldtentry->index),
1759 dtlck->index++;
1774 dtlck->index++;
1821 dtInsertEntry(sp, split->index, split->key, split->data, &dtlck);
1841 lv = & dtlck->lv[dtlck->index];
1846 dtlck->index++;
1946 ASSERT(dtlck->index == 0);
1950 dtlck->index++;
1993 * Update directory index table for entries now in right page
2003 modify_index(tid, ip, le32_to_cpu(ldtentry->index),
2011 * (skip index in the new right page will not change)
2013 dtInsertEntry(rp, split->index, split->key, split->data, &dtlck);
2032 ASSERT(dtlck->index == 0);
2036 dtlck->index++;
2089 int index;
2104 * dtSearch() returns (leaf page pinned, index at which to delete).
2110 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
2113 * We need to find put the index of the next entry into the
2114 * directory index table in order to resume a readdir from this
2119 ldtentry = (struct ldtentry *) & p->slot[stbl[index]];
2120 table_index = le32_to_cpu(ldtentry->index);
2121 if (index == (p->header.nextindex - 1)) {
2140 le32_to_cpu(ldtentry->index);
2146 (struct ldtentry *) & p->slot[stbl[index + 1]];
2147 next_index = le32_to_cpu(ldtentry->index);
2172 * Do not assume that dtlck->index will be zero. During a
2178 if (dtlck->index >= dtlck->maxcnt)
2180 lv = & dtlck->lv[dtlck->index];
2183 dtlck->index++;
2187 if (dtlck->index >= dtlck->maxcnt)
2189 lv = & dtlck->lv[dtlck->index];
2190 i = index >> L2DTSLOTSIZE;
2195 dtlck->index++;
2199 dtDeleteEntry(p, index, &dtlck);
2202 * Update directory index table for entries moved in stbl
2204 if (DO_INDEX(ip) && index < p->header.nextindex) {
2209 for (i = index; i < p->header.nextindex; i++) {
2213 le32_to_cpu(ldtentry->index),
2243 int index, nextindex;
2282 pxdlock->index = 1;
2315 index = parent->index;
2358 pxdlock->index = 1;
2394 if (dtlck->index >= dtlck->maxcnt)
2396 lv = & dtlck->lv[dtlck->index];
2399 dtlck->index++;
2403 if (dtlck->index < dtlck->maxcnt)
2409 i = index >> L2DTSLOTSIZE;
2414 dtlck->index++;
2418 dtDeleteEntry(p, index, &dtlck);
2421 if (index == 0 &&
2452 int index;
2479 DT_GETSEARCH(ip, btstack.top, bn, pmp, pp, index);
2529 ASSERT(dtlck->index == 0);
2533 dtlck->index++;
2543 ASSERT(dtlck->index == 0);
2547 dtlck->index++;
2565 ASSERT(dtlck->index == 0);
2577 dtlck->index++;
2604 pxdlock->index = 1;
2615 lv = & dtlck->lv[dtlck->index];
2619 pxd = (pxd_t *) & pp->slot[stbl[index]];
2621 lv->offset = stbl[index];
2623 dtlck->index++;
2709 btsp->index = i;
2777 if (dtlck->index >= dtlck->maxcnt)
2779 lv = & dtlck->lv[dtlck->index];
2782 dtlck->index++;
2806 if (dtlck->index >= dtlck->maxcnt)
2808 lv = & dtlck->lv[dtlck->index];
2811 dtlck->index++;
2881 ASSERT(dtlck->index == 0);
2885 dtlck->index++;
2914 * function: Fix dtree page in which one or more entries has an invalid index.
2916 * Called from jfs_readdir when bad index is detected.
2923 uint index;
2953 index = le32_to_cpu(d->index);
2954 if ((index < 2) || (index >= JFS_IP(inode)->next_index)) {
2955 d->index = cpu_to_le32(add_index(tid, inode, bn, i));
2956 if (dtlck->index >= dtlck->maxcnt)
2958 lv = &dtlck->lv[dtlck->index];
2961 dtlck->index++;
3002 * return: offset = (pn, index) of start entry
3013 s16 index;
3019 int index;
3034 static int unique_pos = 2; /* If we can't fix broken index */
3041 * persistent index is stored in directory entries.
3080 index = dirtab_slot.slot;
3087 jfs_err("jfs_readdir: bad index table");
3120 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
3126 * pn = index = 0: First entry "."
3127 * pn = 0; index = 1: Second entry ".."
3129 * pn = index = -1: No more entries
3138 dtoffset->index = 1;
3143 if (dtoffset->index == 1) {
3154 dtoffset->index = 0;
3169 /* get start leaf page and index */
3170 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
3194 for (i = index; i < p->header.nextindex; i++) {
3200 index = i;
3211 jfs_dirent->position = le32_to_cpu(d->index);
3213 * d->index should always be valid, but it
3215 * directory index for the lost+found
3226 * index to i will cause the
3231 index = i;
3256 "%ld, bn=%Ld, index = %d",
3274 dtoffset->index++;
3283 index = 0;
3284 /* update offset (pn:index) for new page */
3287 dtoffset->index = 0;
3365 btsp->index = 0;
3380 /* push (bn, index) of the parent page/entry */
3400 * function: get the page of the specified offset (pn:index)
3404 * note: if index > nextindex of the target leaf page,
3413 s16 index;
3419 int index;
3432 DT_GETSEARCH(ip, btstack->top, bn, mp, p, index);
3434 /* get the start offset (pn:index) */
3436 index = dtoffset->index;
3441 if (index < p->header.nextindex)
3451 dtoffset->index = index = 0;
3540 if (index >= p->header.nextindex) {
3559 dtoffset->index = 0;
3566 btsp->index = dtoffset->index;
3586 { /* entry slot index */
3600 * (? if/when dtSearch() narrows down to 1st entry (index = 0),
3605 * if (e->index == 0 && h->prevpg == P_INVALID && !(h->flags & BT_LEAF))
3661 int si, /* entry slot index */
3679 * (? if/when dtSearch() narrows down to 1st entry (index = 0),
3684 * if (e->index == 0 && h->prevpg == P_INVALID && !(h->flags & BT_LEAF))
3834 static void dtGetKey(dtpage_t * p, int i, /* entry index */
3896 * return: entry slot index
3898 static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
3925 if (dtlck->index >= dtlck->maxcnt)
3928 lv = & dtlck->lv[dtlck->index];
3942 lh->index = cpu_to_le32(add_index(data->leaf.tid,
3944 bn, index));
3976 dtlck->index++;
3979 if (dtlck->index < dtlck->maxcnt)
4001 dtlck->index++;
4019 if (index < nextindex) {
4020 memmove(stbl + index + 1, stbl + index, nextindex - index);
4030 for (n = index + 1; n <= nextindex; n++) {
4033 le32_to_cpu(lh->index), bn, n,
4041 stbl[index] = hsi;
4043 /* advance next available entry index of stbl */
4060 int ssi, next; /* src slot index */
4061 int di; /* dst entry index */
4062 int dsi; /* dst slot index */
4080 dlv = & ddtlck->lv[ddtlck->index];
4084 slv = & sdtlck->lv[sdtlck->index];
4100 sdtlck->index++;
4103 if (sdtlck->index < sdtlck->maxcnt)
4130 dlh->index = slh->index; /* little-endian */
4172 sdtlck->index++;
4175 if (sdtlck->index < sdtlck->maxcnt)
4227 sdtlck->index++;
4231 ddtlck->index++;
4259 int fsi; /* free entry slot index */
4267 /* get free entry slot index */
4272 if (dtlck->index >= dtlck->maxcnt)
4274 lv = & dtlck->lv[dtlck->index];
4296 dtlck->index++;
4299 if (dtlck->index < dtlck->maxcnt)
4321 dtlck->index++;
4354 int tsi; /* truncate entry slot index */
4362 /* get free entry slot index */
4367 if (dtlck->index >= dtlck->maxcnt)
4369 lv = & dtlck->lv[dtlck->index];
4391 dtlck->index++;
4394 if (dtlck->index < dtlck->maxcnt)
4416 dtlck->index++;
4433 int m, /* max slot index */
4436 int fsi; /* free entry slot index */
4443 /* get free entry slot index */
4447 if (dtlck->index >= dtlck->maxcnt)
4449 lv = & dtlck->lv[dtlck->index];
4465 dtlck->index++;
4468 if (dtlck->index < dtlck->maxcnt)
4488 dtlck->index++;
4519 int index;
4525 int entry_si; /* entry slot index */
4531 * dtSearch() returns (leaf page pinned, index at which to modify).
4537 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
4546 /* get slot index of the entry */
4548 entry_si = stbl[index];
4551 ASSERT(dtlck->index == 0);
4555 dtlck->index++;