• 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:ip

152 static int dtSplitUp(tid_t tid, struct inode *ip,
155 static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
158 static int dtExtendPage(tid_t tid, struct inode *ip,
161 static int dtSplitRoot(tid_t tid, struct inode *ip,
164 static int dtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp,
167 static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p);
169 static int dtReadFirst(struct inode *ip, struct btstack * btstack);
171 static int dtReadNext(struct inode *ip,
249 static struct dir_table_slot *find_index(struct inode *ip, u32 index,
252 struct jfs_inode_info *jfs_ip = JFS_IP(ip);
272 if (jfs_dirtable_inline(ip)) {
282 JFS_SBI(ip->i_sb)->l2nbperpage;
290 *mp = read_index_page(ip, blkno);
304 static inline void lock_index(tid_t tid, struct inode *ip, struct metapage * mp,
311 tlck = txLock(tid, ip, mp, tlckDATA);
334 static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
336 struct super_block *sb = ip->i_sb;
338 struct jfs_inode_info *jfs_ip = JFS_IP(ip);
350 ASSERT(DO_INDEX(ip));
364 ip->i_size = (loff_t) (index - 1) << 3;
374 set_cflag(COMMIT_Dirtable, ip);
385 if (dquot_alloc_block(ip, sbi->nbperpage))
387 if (dbAlloc(ip, 0, sbi->nbperpage, &xaddr)) {
388 dquot_free_block(ip, sbi->nbperpage);
401 xtInitRoot(tid, ip);
406 if (xtInsert(tid, ip, 0, 0, sbi->nbperpage, &xaddr, 0)) {
411 dbFree(ip, xaddr, sbi->nbperpage);
412 dquot_free_block(ip, sbi->nbperpage);
415 ip->i_size = PSIZE;
417 mp = get_index_page(ip, 0);
420 xtTruncate(tid, ip, 0, COMMIT_PWMAP);
425 tlck = txLock(tid, ip, mp, tlckDATA);
442 clear_cflag(COMMIT_Dirtable, ip);
453 if (xtInsert(tid, ip, 0, blkno, sbi->nbperpage, &xaddr, 0)) {
457 ip->i_size += PSIZE;
459 if ((mp = get_index_page(ip, blkno)))
462 xtTruncate(tid, ip, offset, COMMIT_PWMAP);
464 mp = read_index_page(ip, blkno);
471 lock_index(tid, ip, mp, index);
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);
516 set_cflag(COMMIT_Dirtable, ip);
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);
541 set_cflag(COMMIT_Dirtable, ip);
549 static int read_index(struct inode *ip, u32 index,
556 slot = find_index(ip, index, &mp, &lblock);
580 int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
595 struct super_block *sb = ip->i_sb;
635 DT_GETPAGE(ip, bn, mp, psize, p, rc);
792 psize = lengthPXD(pxd) << JFS_SBI(ip->i_sb)->l2bsize;
821 int dtInsert(tid_t tid, struct inode *ip,
843 DT_GETSEARCH(ip, btstack->top, bn, mp, p, index);
848 if (DO_INDEX(ip)) {
849 if (JFS_IP(ip)->next_index == DIREND) {
855 data.leaf.ip = ip;
858 data.leaf.ip = NULL; /* signifies legacy directory format */
875 rc = dtSplitUp(tid, ip, &split, btstack);
884 BT_MARK_DIRTY(mp, ip);
888 tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
931 struct inode *ip, struct dtsplit * split, struct btstack * btstack)
933 struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
958 sp = DT_PAGE(ip, smp);
986 if ((rc = dbAlloc(ip, 0, (s64) xlen, &xaddr))) {
997 rc = dtSplitRoot(tid, ip, split, &rmp);
1000 dbFree(ip, xaddr, xlen);
1006 if (!DO_INDEX(ip))
1007 ip->i_size = xlen << sbi->l2bsize;
1031 rc = dquot_alloc_block(ip, n);
1046 if ((rc = dtExtendPage(tid, ip, split, btstack))) {
1051 dbFree(ip, nxaddr, (s64) xlen);
1056 dbFree(ip, xaddr, (s64) n);
1058 } else if (!DO_INDEX(ip))
1059 ip->i_size = lengthPXD(pxd) << sbi->l2bsize;
1082 if ((rc = dbAlloc(ip, 0, (s64) xlen, &xaddr)) == 0) {
1096 if ((rc = dtSplitPage(tid, ip, split, &rmp, &rp, &rpxd))) {
1103 if (!DO_INDEX(ip))
1104 ip->i_size += PSIZE;
1138 DT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
1248 dtSplitRoot(tid, ip, split, &rmp) :
1249 dtSplitPage(tid, ip, split, &rmp, &rp, &rpxd);
1261 BT_MARK_DIRTY(smp, ip);
1265 tlck = txLock(tid, ip, smp, tlckDTREE | tlckENTRY);
1304 dbFree(ip, addressPXD(pxd), (s64) lengthPXD(pxd));
1311 dquot_free_block(ip, quota_allocation);
1330 static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
1358 sp = DT_PAGE(ip, smp);
1367 rmp = get_metapage(ip, rbn, PSIZE, 1);
1372 rc = dquot_alloc_block(ip, lengthPXD(pxd));
1378 jfs_info("dtSplitPage: ip:0x%p smp:0x%p rmp:0x%p", ip, smp, rmp);
1380 BT_MARK_DIRTY(rmp, ip);
1384 tlck = txLock(tid, ip, rmp, tlckDTREE | tlckNEW);
1391 BT_MARK_DIRTY(smp, ip);
1397 tlck = txLock(tid, ip, smp, tlckDTREE | tlckENTRY);
1475 DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
1481 BT_MARK_DIRTY(mp, ip);
1485 tlck = txLock(tid, ip, mp, tlckDTREE | tlckRELINK);
1486 jfs_info("dtSplitPage: tlck = 0x%p, ip = 0x%p, mp=0x%p",
1487 tlck, ip, mp);
1525 if (DO_INDEX(ip))
1565 dtMoveEntry(sp, nxt, rp, &sdtlck, &rdtlck, DO_INDEX(ip));
1581 if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
1588 modify_index(tid, ip, le32_to_cpu(ldtentry->index),
1643 struct inode *ip, struct dtsplit * split, struct btstack * btstack)
1645 struct super_block *sb = ip->i_sb;
1669 sp = DT_PAGE(ip, smp);
1673 DT_GETPAGE(ip, parent->bn, pmp, PSIZE, pp, rc);
1696 tlck = txMaplock(tid, ip, tlckDTREE | tlckRELOCATE);
1705 if (DO_INDEX(ip)) {
1713 modify_index(tid, ip,
1727 jfs_info("dtExtendPage: ip:0x%p smp:0x%p sp:0x%p", ip, smp, sp);
1729 BT_MARK_DIRTY(smp, ip);
1733 tlck = txLock(tid, ip, smp, tlckDTREE | type);
1823 BT_MARK_DIRTY(pmp, ip);
1839 tlck = txLock(tid, ip, pmp, tlckDTREE | tlckENTRY);
1876 struct inode *ip, struct dtsplit * split, struct metapage ** rmpp)
1878 struct super_block *sb = ip->i_sb;
1900 sp = &JFS_IP(ip)->i_dtroot;
1914 rmp = get_metapage(ip, rbn, xsize, 1);
1921 rc = dquot_alloc_block(ip, lengthPXD(pxd));
1927 BT_MARK_DIRTY(rmp, ip);
1931 tlck = txLock(tid, ip, rmp, tlckDTREE | tlckNEW);
1995 if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
2003 modify_index(tid, ip, le32_to_cpu(ldtentry->index),
2024 BT_MARK_DIRTY(smp, ip);
2028 tlck = txLock(tid, ip, smp, tlckDTREE | tlckNEW | tlckBTROOT);
2083 struct inode *ip, struct component_name * key, ino_t * ino, int flag)
2106 if ((rc = dtSearch(ip, key, ino, &btstack, flag)))
2110 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
2117 if (DO_INDEX(ip)) {
2130 DT_GETPAGE(ip, le64_to_cpu(p->header.next),
2149 free_index(tid, ip, table_index, next_index);
2156 rc = dtDeleteUp(tid, ip, mp, p, &btstack);
2164 BT_MARK_DIRTY(mp, ip);
2168 tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
2204 if (DO_INDEX(ip) && index < p->header.nextindex) {
2212 modify_index(tid, ip,
2237 static int dtDeleteUp(tid_t tid, struct inode *ip,
2261 dtInitRoot(tid, ip, PARENT(ip));
2278 tlck = txMaplock(tid, ip, tlckDTREE | tlckFREE);
2285 if ((rc = dtRelink(tid, ip, fp))) {
2293 dquot_free_block(ip, xlen);
2308 DT_GETPAGE(ip, parent->bn, mp, PSIZE, p, rc);
2337 dtInitRoot(tid, ip, PARENT(ip));
2353 txMaplock(tid, ip,
2361 if ((rc = dtRelink(tid, ip, p))) {
2369 dquot_free_block(ip, xlen);
2384 BT_MARK_DIRTY(mp, ip);
2390 tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
2432 if (!DO_INDEX(ip))
2433 ip->i_size -= PSIZE;
2445 int dtRelocate(tid_t tid, struct inode *ip, s64 lmxaddr, pxd_t * opxd,
2474 rc = dtSearchNode(ip, lmxaddr, opxd, &btstack);
2479 DT_GETSEARCH(ip, btstack.top, bn, pmp, pp, index);
2486 DT_GETPAGE(ip, oxaddr, mp, PSIZE, p, rc);
2499 DT_GETPAGE(ip, nextbn, rmp, PSIZE, rp, rc);
2510 DT_GETPAGE(ip, prevbn, lmp, PSIZE, lp, rc);
2526 tlck = txLock(tid, ip, lmp, tlckDTREE | tlckRELINK);
2540 tlck = txLock(tid, ip, rmp, tlckDTREE | tlckRELINK);
2562 tlck = txLock(tid, ip, mp, tlckDTREE | tlckNEW);
2580 xsize = xlen << JFS_SBI(ip->i_sb)->l2bsize;
2599 tlck = txMaplock(tid, ip, tlckDTREE | tlckFREE);
2613 tlck = txLock(tid, ip, pmp, tlckDTREE | tlckENTRY);
2642 static int dtSearchNode(struct inode *ip, s64 lmxaddr, pxd_t * kpxd,
2664 DT_GETPAGE(ip, bn, mp, psize, p, rc);
2691 psize = lengthPXD(pxd) << JFS_SBI(ip->i_sb)->l2bsize;
2728 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
2747 static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p)
2761 DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
2765 BT_MARK_DIRTY(mp, ip);
2771 tlck = txLock(tid, ip, mp, tlckDTREE | tlckRELINK);
2772 jfs_info("dtRelink nextbn: tlck = 0x%p, ip = 0x%p, mp=0x%p",
2773 tlck, ip, mp);
2790 DT_GETPAGE(ip, prevbn, mp, PSIZE, p, rc);
2794 BT_MARK_DIRTY(mp, ip);
2800 tlck = txLock(tid, ip, mp, tlckDTREE | tlckRELINK);
2801 jfs_info("dtRelink prevbn: tlck = 0x%p, ip = 0x%p, mp=0x%p",
2802 tlck, ip, mp);
2826 void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot)
2828 struct jfs_inode_info *jfs_ip = JFS_IP(ip);
2841 if (DO_INDEX(ip)) {
2842 if (!jfs_dirtable_inline(ip)) {
2860 xtTruncate(tid, ip, 0, COMMIT_PWMAP);
2861 set_cflag(COMMIT_Stale, ip);
2865 ip->i_size = 1;
2869 ip->i_size = IDATASIZE;
2876 tlck = txLock(tid, ip, (struct metapage *) & jfs_ip->bxflag,
3007 struct inode *ip = filp->f_path.dentry->d_inode;
3008 struct nls_table *codepage = JFS_SBI(ip->i_sb)->nls_tab;
3039 if (DO_INDEX(ip)) {
3053 if (dtEmpty(ip) ||
3054 (dir_index >= JFS_IP(ip)->next_index)) {
3060 rc = read_index(ip, dir_index, &dirtab_slot);
3066 if (loop_count++ > JFS_IP(ip)->next_index) {
3081 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
3098 if (filldir(dirent, ".", 1, 0, ip->i_ino,
3106 if (filldir(dirent, "..", 2, 1, PARENT(ip), DT_DIR))
3112 if (dtEmpty(ip)) {
3117 if ((rc = dtReadFirst(ip, &btstack)))
3120 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
3135 if (filldir(dirent, ".", 1, filp->f_pos, ip->i_ino,
3147 PARENT(ip), DT_DIR))
3158 if (dtEmpty(ip)) {
3163 if ((rc = dtReadNext(ip, &filp->f_pos, &btstack))) {
3170 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
3221 JFS_IP(ip)->next_index)) {
3222 if (!page_fixed && !isReadOnly(ip)) {
3254 jfs_error(ip->i_sb,
3257 (long)ip->i_ino,
3307 add_missing_indices(ip, bn);
3316 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
3335 static int dtReadFirst(struct inode *ip, struct btstack * btstack)
3354 DT_GETPAGE(ip, bn, mp, psize, p, rc);
3376 jfs_error(ip->i_sb, "dtReadFirst: btstack overrun");
3389 psize = lengthPXD(xd) << JFS_SBI(ip->i_sb)->l2bsize;
3407 static int dtReadNext(struct inode *ip, loff_t * offset,
3428 if ((rc = dtReadFirst(ip, btstack)))
3432 DT_GETSEARCH(ip, btstack->top, bn, mp, p, index);
3491 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
3512 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
3532 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
3553 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
3938 if (data->leaf.ip) {
3943 data->leaf.ip,
4022 if ((p->header.flag & BT_LEAF) && data->leaf.ip) {
4032 modify_index(data->leaf.tid, data->leaf.ip,
4501 * ip - Inode of parent directory
4512 int dtModify(tid_t tid, struct inode *ip,
4533 if ((rc = dtSearch(ip, key, orig_ino, &btstack, flag)))
4537 DT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
4539 BT_MARK_DIRTY(mp, ip);
4543 tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);