/* * Copyright (C) International Business Machines Corp., 2000-2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _H_JFS_BTREE #define _H_JFS_BTREE /* * jfs_btree.h: B+-tree * * JFS B+-tree (dtree and xtree) common definitions */ /* * basic btree page - btpage * struct btpage { s64 next; right sibling bn s64 prev; left sibling bn u8 flag; u8 rsrvd[7]; type specific s64 self; self address u8 entry[4064]; }; */ /* btpaget_t flag */ #define BT_TYPE 0x07 /* B+-tree index */ #define BT_ROOT 0x01 /* root page */ #define BT_LEAF 0x02 /* leaf page */ #define BT_INTERNAL 0x04 /* internal page */ #define BT_RIGHTMOST 0x10 /* rightmost page */ #define BT_LEFTMOST 0x20 /* leftmost page */ #define BT_SWAPPED 0x80 /* used by fsck for endian swapping */ /* btorder (in inode) */ #define BT_RANDOM 0x0000 #define BT_SEQUENTIAL 0x0001 #define BT_LOOKUP 0x0010 #define BT_INSERT 0x0020 #define BT_DELETE 0x0040 /* * btree page buffer cache access */ #define BT_IS_ROOT(MP) (((MP)->xflag & COMMIT_PAGE) == 0) /* get page from buffer page */ #define BT_PAGE(IP, MP, TYPE, ROOT)\ (BT_IS_ROOT(MP) ? (TYPE *)&JFS_IP(IP)->ROOT : (TYPE *)(MP)->data) /* get the page buffer and the page for specified block address */ #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\ {\ if ((BN) == 0)\ {\ MP = (struct metapage *)&JFS_IP(IP)->bxflag;\ P = (TYPE *)&JFS_IP(IP)->ROOT;\ RC = 0;\ }\ else\ {\ MP = read_metapage((IP), BN, SIZE, 1);\ if (MP) {\ RC = 0;\ P = (MP)->data;\ } else {\ P = NULL;\ jfs_err("bread failed!");\ RC = -EIO;\ }\ }\ } #define BT_MARK_DIRTY(MP, IP)\ {\ if (BT_IS_ROOT(MP))\ mark_inode_dirty(IP);\ else\ mark_metapage_dirty(MP);\ } /* put the page buffer */ #define BT_PUTPAGE(MP)\ {\ if (! BT_IS_ROOT(MP)) \ release_metapage(MP); \ } /* * btree traversal stack * * record the path traversed during the search; * top frame record the leaf page/entry selected. */ struct btframe { /* stack frame */ s64 bn; /* 8: */ s16 index; /* 2: */ s16 lastindex; /* 2: unused */ struct metapage *mp; /* 4/8: */ }; /* (16/24) */ struct btstack { struct btframe *top; int nsplit; struct btframe stack[MAXTREEHEIGHT]; }; #define BT_CLR(btstack)\ (btstack)->top = (btstack)->stack #define BT_STACK_FULL(btstack)\ ( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1])) #define BT_PUSH(BTSTACK, BN, INDEX)\ {\ assert(!BT_STACK_FULL(BTSTACK));\ (BTSTACK)->top->bn = BN;\ (BTSTACK)->top->index = INDEX;\ ++(BTSTACK)->top;\ } #define BT_POP(btstack)\ ( (btstack)->top == (btstack)->stack ? NULL : --(btstack)->top ) #define BT_STACK(btstack)\ ( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top ) static inline void BT_STACK_DUMP(struct btstack *btstack) { int i; printk("btstack dump:\n"); for (i = 0; i < MAXTREEHEIGHT; i++) printk(KERN_ERR "bn = %Lx, index = %d\n", (long long)btstack->stack[i].bn, btstack->stack[i].index); } /* retrieve search results */ #define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)\ {\ BN = (LEAF)->bn;\ MP = (LEAF)->mp;\ if (BN)\ P = (TYPE *)MP->data;\ else\ P = (TYPE *)&JFS_IP(IP)->ROOT;\ INDEX = (LEAF)->index;\ } /* put the page buffer of search */ #define BT_PUTSEARCH(BTSTACK)\ {\ if (! BT_IS_ROOT((BTSTACK)->top->mp))\ release_metapage((BTSTACK)->top->mp);\ } #endif /* _H_JFS_BTREE */ <option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'> <tr><th>author</th><td>Stanislaw Gruszka <sgruszka@redhat.com></td><td class='right'>2017-01-29 12:40:52 +0100</td></tr> <tr><th>committer</th><td>Kalle Valo <kvalo@codeaurora.org></td><td class='right'>2017-01-31 09:08:52 +0200</td></tr> <tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/net/switchdev/Kconfig?h=nds-private-remove&id=33e962c8871f015f5c8978384553dddcf5b81b22'>33e962c8871f015f5c8978384553dddcf5b81b22</a> (<a href='/cgit.cgi/linux/net-next.git/patch/net/switchdev/Kconfig?id=33e962c8871f015f5c8978384553dddcf5b81b22'>patch</a>)</td></tr> <tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?h=nds-private-remove&id=33e962c8871f015f5c8978384553dddcf5b81b22'>43aff96c2ee21d9e0fa2018457778a4de52053cd</a> /<a href='/cgit.cgi/linux/net-next.git/tree/net/switchdev/Kconfig?h=nds-private-remove&id=33e962c8871f015f5c8978384553dddcf5b81b22'>net/switchdev/Kconfig</a></td></tr> <tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/net/switchdev/Kconfig?h=nds-private-remove&id=575ddce0507789bf9830d089557d2199d2f91865'>575ddce0507789bf9830d089557d2199d2f91865</a> (<a href='/cgit.cgi/linux/net-next.git/diff/net/switchdev/Kconfig?h=nds-private-remove&id=33e962c8871f015f5c8978384553dddcf5b81b22&id2=575ddce0507789bf9830d089557d2199d2f91865'>diff</a>)</td></tr></table> <div class='commit-subject'>rt2x00: fix clk_get call</div><div class='commit-msg'>clk_get() takes two arguments and might return ERR_PTR(), so we have to nullify pointer on that case, to do not break further call to clk_get_rate(). Reported-by: Felix Fietkau <nbd@nbd.name> Fixes: 34db70b92fae ("rt2x00: add copy of clk for soc devices") Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> </div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&id=33e962c8871f015f5c8978384553dddcf5b81b22'>Diffstat</a> (limited to 'net/switchdev/Kconfig')</div><table summary='diffstat' class='diffstat'>