Lines Matching refs:index
117 s16 index; member
185 static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
249 static struct dir_table_slot *find_index(struct inode *ip, u32 index, in find_index() argument
259 if (index < 2) { in find_index()
261 jfs_warn("find_entry called with index = %d", index); in find_index()
267 if (index >= jfs_ip->next_index) { in find_index()
277 slot = &jfs_ip->i_dirtable[index - 2]; in find_index()
279 offset = (index - 2) * sizeof(struct dir_table_slot); in find_index()
305 u32 index) in lock_index() argument
314 if (llck->index >= llck->maxcnt) in lock_index()
316 lv = &llck->lv[llck->index]; in lock_index()
322 lv->offset = ((index - 2) & 511) >> 1; in lock_index()
324 llck->index++; in lock_index()
341 u32 index; in add_index() local
358 index = jfs_ip->next_index++; in add_index()
360 if (index <= MAX_INLINE_DIRTABLE_ENTRY) { in add_index()
364 ip->i_size = (loff_t) (index - 1) << 3; in add_index()
369 dirtab_slot = &jfs_ip->i_dirtable[index-2]; in add_index()
376 return index; in add_index()
378 if (index == (MAX_INLINE_DIRTABLE_ENTRY + 1)) { in add_index()
427 ASSERT(llck->index == 0); in add_index()
432 llck->index++; in add_index()
445 offset = (index - 2) * sizeof(struct dir_table_slot); in add_index()
471 lock_index(tid, ip, mp, index); in add_index()
482 return index; in add_index()
496 static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next) in free_index() argument
502 dirtab_slot = find_index(ip, index, &mp, &lblock); in free_index()
512 lock_index(tid, ip, mp, index); in free_index()
524 static void modify_index(tid_t tid, struct inode *ip, u32 index, s64 bn, in modify_index() argument
529 dirtab_slot = find_index(ip, index, mp, lblock); in modify_index()
538 lock_index(tid, ip, *mp, index); in modify_index()
549 static int read_index(struct inode *ip, u32 index, in read_index() argument
556 slot = find_index(ip, index, &mp, &lblock); in read_index()
589 int base, index, lim; in dtSearch() local
646 index = base + (lim >> 1); in dtSearch()
651 ciCompare(&ciKey, p, stbl[index], in dtSearch()
656 cmp = dtCompare(&ciKey, p, stbl[index]); in dtSearch()
669 ((struct ldtentry *) & p->slot[stbl[index]])->inumber); in dtSearch()
706 btsp->index = index; in dtSearch()
720 base = index + 1; in dtSearch()
755 btsp->index = base; in dtSearch()
768 index = base ? base - 1 : base; in dtSearch()
787 BT_PUSH(btstack, bn, index); in dtSearch()
790 pxd = (pxd_t *) & p->slot[stbl[index]]; in dtSearch()
828 int index; in dtInsert() local
843 DT_GETSEARCH(ip, btstack->top, bn, mp, p, index); in dtInsert()
871 split.index = index; in dtInsert()
890 ASSERT(dtlck->index == 0); in dtInsert()
896 dtlck->index++; in dtInsert()
898 dtInsertEntry(p, index, name, &data, &dtlck); in dtInsert()
902 if (dtlck->index >= dtlck->maxcnt) in dtInsert()
904 lv = & dtlck->lv[dtlck->index]; in dtInsert()
905 n = index >> L2DTSLOTSIZE; in dtInsert()
909 dtlck->index++; in dtInsert()
1149 skip = parent->index + 1; in dtSplitUp()
1235 split->index = skip; /* index at insert */ in dtSplitUp()
1267 ASSERT(dtlck->index == 0); in dtSplitUp()
1273 dtlck->index++; in dtSplitUp()
1283 dtlck->index++; in dtSplitUp()
1401 ASSERT(sdtlck->index == 0); in dtSplitPage()
1405 sdtlck->index++; in dtSplitPage()
1446 if (nextbn == 0 && split->index == sp->header.nextindex) { in dtSplitPage()
1448 rlv = & rdtlck->lv[rdtlck->index]; in dtSplitPage()
1451 rdtlck->index++; in dtSplitPage()
1491 lv = & dtlck->lv[dtlck->index]; in dtSplitPage()
1494 dtlck->index++; in dtSplitPage()
1504 skip = split->index; in dtSplitPage()
1560 rlv = & rdtlck->lv[rdtlck->index]; in dtSplitPage()
1563 rdtlck->index++; in dtSplitPage()
1588 modify_index(tid, ip, le32_to_cpu(ldtentry->index), in dtSplitPage()
1603 if (sdtlck->index >= sdtlck->maxcnt) in dtSplitPage()
1605 slv = & sdtlck->lv[sdtlck->index]; in dtSplitPage()
1610 sdtlck->index++; in dtSplitPage()
1700 pxdlock->index = 1; in dtExtendPage()
1714 le32_to_cpu(ldtentry->index), in dtExtendPage()
1759 dtlck->index++; in dtExtendPage()
1774 dtlck->index++; in dtExtendPage()
1821 dtInsertEntry(sp, split->index, split->key, split->data, &dtlck); in dtExtendPage()
1841 lv = & dtlck->lv[dtlck->index]; in dtExtendPage()
1846 dtlck->index++; in dtExtendPage()
1946 ASSERT(dtlck->index == 0); in dtSplitRoot()
1950 dtlck->index++; in dtSplitRoot()
2003 modify_index(tid, ip, le32_to_cpu(ldtentry->index), in dtSplitRoot()
2013 dtInsertEntry(rp, split->index, split->key, split->data, &dtlck); in dtSplitRoot()
2032 ASSERT(dtlck->index == 0); in dtSplitRoot()
2036 dtlck->index++; in dtSplitRoot()
2089 int index; in dtDelete() local
2110 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index); in dtDelete()
2119 ldtentry = (struct ldtentry *) & p->slot[stbl[index]]; in dtDelete()
2120 table_index = le32_to_cpu(ldtentry->index); in dtDelete()
2121 if (index == (p->header.nextindex - 1)) { in dtDelete()
2140 le32_to_cpu(ldtentry->index); in dtDelete()
2146 (struct ldtentry *) & p->slot[stbl[index + 1]]; in dtDelete()
2147 next_index = le32_to_cpu(ldtentry->index); in dtDelete()
2178 if (dtlck->index >= dtlck->maxcnt) in dtDelete()
2180 lv = & dtlck->lv[dtlck->index]; in dtDelete()
2183 dtlck->index++; in dtDelete()
2187 if (dtlck->index >= dtlck->maxcnt) in dtDelete()
2189 lv = & dtlck->lv[dtlck->index]; in dtDelete()
2190 i = index >> L2DTSLOTSIZE; in dtDelete()
2195 dtlck->index++; in dtDelete()
2199 dtDeleteEntry(p, index, &dtlck); in dtDelete()
2204 if (DO_INDEX(ip) && index < p->header.nextindex) { in dtDelete()
2209 for (i = index; i < p->header.nextindex; i++) { in dtDelete()
2213 le32_to_cpu(ldtentry->index), in dtDelete()
2243 int index, nextindex; in dtDeleteUp() local
2282 pxdlock->index = 1; in dtDeleteUp()
2315 index = parent->index; in dtDeleteUp()
2358 pxdlock->index = 1; in dtDeleteUp()
2394 if (dtlck->index >= dtlck->maxcnt) in dtDeleteUp()
2396 lv = & dtlck->lv[dtlck->index]; in dtDeleteUp()
2399 dtlck->index++; in dtDeleteUp()
2403 if (dtlck->index < dtlck->maxcnt) in dtDeleteUp()
2409 i = index >> L2DTSLOTSIZE; in dtDeleteUp()
2414 dtlck->index++; in dtDeleteUp()
2418 dtDeleteEntry(p, index, &dtlck); in dtDeleteUp()
2421 if (index == 0 && in dtDeleteUp()
2452 int index; in dtRelocate() local
2479 DT_GETSEARCH(ip, btstack.top, bn, pmp, pp, index); in dtRelocate()
2529 ASSERT(dtlck->index == 0); in dtRelocate()
2533 dtlck->index++; in dtRelocate()
2543 ASSERT(dtlck->index == 0); in dtRelocate()
2547 dtlck->index++; in dtRelocate()
2565 ASSERT(dtlck->index == 0); in dtRelocate()
2577 dtlck->index++; in dtRelocate()
2604 pxdlock->index = 1; in dtRelocate()
2615 lv = & dtlck->lv[dtlck->index]; in dtRelocate()
2619 pxd = (pxd_t *) & pp->slot[stbl[index]]; in dtRelocate()
2621 lv->offset = stbl[index]; in dtRelocate()
2623 dtlck->index++; in dtRelocate()
2709 btsp->index = i; in dtSearchNode()
2777 if (dtlck->index >= dtlck->maxcnt) in dtRelink()
2779 lv = & dtlck->lv[dtlck->index]; in dtRelink()
2782 dtlck->index++; in dtRelink()
2806 if (dtlck->index >= dtlck->maxcnt) in dtRelink()
2808 lv = & dtlck->lv[dtlck->index]; in dtRelink()
2811 dtlck->index++; in dtRelink()
2881 ASSERT(dtlck->index == 0); in dtInitRoot()
2885 dtlck->index++; in dtInitRoot()
2923 uint index; in add_missing_indices() local
2953 index = le32_to_cpu(d->index); in add_missing_indices()
2954 if ((index < 2) || (index >= JFS_IP(inode)->next_index)) { in add_missing_indices()
2955 d->index = cpu_to_le32(add_index(tid, inode, bn, i)); in add_missing_indices()
2956 if (dtlck->index >= dtlck->maxcnt) in add_missing_indices()
2958 lv = &dtlck->lv[dtlck->index]; in add_missing_indices()
2961 dtlck->index++; in add_missing_indices()
3013 s16 index; in jfs_readdir() member
3019 int index; in jfs_readdir() local
3087 index = dirtab_slot.slot; in jfs_readdir()
3126 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index); in jfs_readdir()
3143 dtoffset->index = 2; in jfs_readdir()
3148 if (dtoffset->index == 2) { in jfs_readdir()
3156 dtoffset->index = 0; in jfs_readdir()
3172 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index); in jfs_readdir()
3196 for (i = index; i < p->header.nextindex; i++) { in jfs_readdir()
3202 index = i; in jfs_readdir()
3213 jfs_dirent->position = le32_to_cpu(d->index); in jfs_readdir()
3233 index = i; in jfs_readdir()
3281 dtoffset->index++; in jfs_readdir()
3290 index = 0; in jfs_readdir()
3294 dtoffset->index = 0; in jfs_readdir()
3372 btsp->index = 0; in dtReadFirst()
3420 s16 index; in dtReadNext() member
3426 int index; in dtReadNext() local
3439 DT_GETSEARCH(ip, btstack->top, bn, mp, p, index); in dtReadNext()
3443 index = dtoffset->index; in dtReadNext()
3448 if (index < p->header.nextindex) in dtReadNext()
3458 dtoffset->index = index = 0; in dtReadNext()
3547 if (index >= p->header.nextindex) { in dtReadNext()
3566 dtoffset->index = 0; in dtReadNext()
3573 btsp->index = dtoffset->index; in dtReadNext()
3905 static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key, in dtInsertEntry() argument
3932 if (dtlck->index >= dtlck->maxcnt) in dtInsertEntry()
3935 lv = & dtlck->lv[dtlck->index]; in dtInsertEntry()
3949 lh->index = cpu_to_le32(add_index(data->leaf.tid, in dtInsertEntry()
3951 bn, index)); in dtInsertEntry()
3983 dtlck->index++; in dtInsertEntry()
3986 if (dtlck->index < dtlck->maxcnt) in dtInsertEntry()
4008 dtlck->index++; in dtInsertEntry()
4026 if (index < nextindex) { in dtInsertEntry()
4027 memmove(stbl + index + 1, stbl + index, nextindex - index); in dtInsertEntry()
4037 for (n = index + 1; n <= nextindex; n++) { in dtInsertEntry()
4040 le32_to_cpu(lh->index), bn, n, in dtInsertEntry()
4048 stbl[index] = hsi; in dtInsertEntry()
4087 dlv = & ddtlck->lv[ddtlck->index]; in dtMoveEntry()
4091 slv = & sdtlck->lv[sdtlck->index]; in dtMoveEntry()
4107 sdtlck->index++; in dtMoveEntry()
4110 if (sdtlck->index < sdtlck->maxcnt) in dtMoveEntry()
4137 dlh->index = slh->index; /* little-endian */ in dtMoveEntry()
4179 sdtlck->index++; in dtMoveEntry()
4182 if (sdtlck->index < sdtlck->maxcnt) in dtMoveEntry()
4234 sdtlck->index++; in dtMoveEntry()
4238 ddtlck->index++; in dtMoveEntry()
4279 if (dtlck->index >= dtlck->maxcnt) in dtDeleteEntry()
4281 lv = & dtlck->lv[dtlck->index]; in dtDeleteEntry()
4303 dtlck->index++; in dtDeleteEntry()
4306 if (dtlck->index < dtlck->maxcnt) in dtDeleteEntry()
4328 dtlck->index++; in dtDeleteEntry()
4374 if (dtlck->index >= dtlck->maxcnt) in dtTruncateEntry()
4376 lv = & dtlck->lv[dtlck->index]; in dtTruncateEntry()
4398 dtlck->index++; in dtTruncateEntry()
4401 if (dtlck->index < dtlck->maxcnt) in dtTruncateEntry()
4423 dtlck->index++; in dtTruncateEntry()
4454 if (dtlck->index >= dtlck->maxcnt) in dtLinelockFreelist()
4456 lv = & dtlck->lv[dtlck->index]; in dtLinelockFreelist()
4472 dtlck->index++; in dtLinelockFreelist()
4475 if (dtlck->index < dtlck->maxcnt) in dtLinelockFreelist()
4495 dtlck->index++; in dtLinelockFreelist()
4526 int index; in dtModify() local
4544 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index); in dtModify()
4555 entry_si = stbl[index]; in dtModify()
4558 ASSERT(dtlck->index == 0); in dtModify()
4562 dtlck->index++; in dtModify()