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

Lines Matching defs:ac

109 static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
140 struct ocfs2_alloc_context **ac);
142 void ocfs2_free_ac_resource(struct ocfs2_alloc_context *ac)
144 struct inode *inode = ac->ac_inode;
147 if (ac->ac_which != OCFS2_AC_USE_LOCAL)
153 ac->ac_inode = NULL;
155 brelse(ac->ac_bh);
156 ac->ac_bh = NULL;
157 ac->ac_resv = NULL;
158 if (ac->ac_find_loc_priv) {
159 kfree(ac->ac_find_loc_priv);
160 ac->ac_find_loc_priv = NULL;
164 void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac)
166 ocfs2_free_ac_resource(ac);
167 kfree(ac);
460 struct ocfs2_alloc_context *ac,
469 status = ocfs2_claim_clusters(handle, ac,
504 struct ocfs2_alloc_context *ac,
511 status = ocfs2_claim_clusters(handle, ac, min_bits,
525 struct ocfs2_alloc_context *ac,
552 status = ocfs2_block_group_claim_bits(osb, handle, ac,
617 struct ocfs2_alloc_context *ac,
646 ac->ac_allow_chain_relink = 0;
649 status = ocfs2_block_group_claim_bits(osb, handle, ac, min_bits,
679 bg_bh, ac, cl, min_bits);
685 ocfs2_bg_alloc_cleanup(handle, ac, alloc_inode, bg_bh);
702 struct ocfs2_alloc_context *ac = NULL;
715 max_block, flags, &ac);
735 ac->ac_last_group = *last_alloc_group;
739 ac, cl);
743 ac, cl);
788 *last_alloc_group = ac->ac_last_group;
794 if (ac)
795 ocfs2_free_alloc_context(ac);
804 struct ocfs2_alloc_context *ac,
811 u32 bits_wanted = ac->ac_bits_wanted;
836 ac->ac_inode = alloc_inode;
837 ac->ac_alloc_slot = slot;
873 ac->ac_max_block,
889 ac->ac_bh = bh;
954 struct ocfs2_alloc_context *ac,
971 status = ocfs2_reserve_suballoc_bits(osb, ac,
980 ocfs2_free_ac_resource(ac);
987 struct ocfs2_alloc_context *ac)
989 return ocfs2_steal_resource(osb, ac, INODE_ALLOC_SYSTEM_INODE);
993 struct ocfs2_alloc_context *ac)
995 return ocfs2_steal_resource(osb, ac, EXTENT_ALLOC_SYSTEM_INODE);
1000 struct ocfs2_alloc_context **ac)
1005 *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL);
1006 if (!(*ac)) {
1012 (*ac)->ac_bits_wanted = blocks;
1013 (*ac)->ac_which = OCFS2_AC_USE_META;
1014 (*ac)->ac_group_search = ocfs2_block_group_search;
1021 status = ocfs2_reserve_suballoc_bits(osb, (*ac),
1037 ocfs2_free_ac_resource(*ac);
1040 status = ocfs2_steal_meta(osb, *ac);
1050 if ((status < 0) && *ac) {
1051 ocfs2_free_alloc_context(*ac);
1052 *ac = NULL;
1061 struct ocfs2_alloc_context **ac)
1065 ac);
1069 struct ocfs2_alloc_context **ac)
1075 *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL);
1076 if (!(*ac)) {
1082 (*ac)->ac_bits_wanted = 1;
1083 (*ac)->ac_which = OCFS2_AC_USE_INODE;
1085 (*ac)->ac_group_search = ocfs2_block_group_search;
1093 (*ac)->ac_max_block = (u32)~0U;
1110 status = ocfs2_reserve_suballoc_bits(osb, *ac,
1137 ocfs2_free_ac_resource(*ac);
1140 status = ocfs2_steal_inode(osb, *ac);
1150 if ((status < 0) && *ac) {
1151 ocfs2_free_alloc_context(*ac);
1152 *ac = NULL;
1162 struct ocfs2_alloc_context *ac)
1166 ac->ac_which = OCFS2_AC_USE_MAIN;
1167 ac->ac_group_search = ocfs2_cluster_group_search;
1169 status = ocfs2_reserve_suballoc_bits(osb, ac,
1188 struct ocfs2_alloc_context **ac)
1194 *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL);
1195 if (!(*ac)) {
1201 (*ac)->ac_bits_wanted = bits_wanted;
1202 (*ac)->ac_max_block = max_block;
1209 *ac);
1217 status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac);
1227 if ((status < 0) && *ac) {
1228 ocfs2_free_alloc_context(*ac);
1229 *ac = NULL;
1238 struct ocfs2_alloc_context **ac)
1241 ALLOC_NEW_GROUP, ac);
1640 static void ocfs2_bg_discontig_fix_result(struct ocfs2_alloc_context *ac,
1647 struct ocfs2_dinode *di = (struct ocfs2_dinode *)ac->ac_bh->b_data;
1650 if (ocfs2_is_cluster_bitmap(ac->ac_inode)) {
1657 if (!ocfs2_supports_discontig_bg(OCFS2_SB(ac->ac_inode->i_sb)) ||
1670 static int ocfs2_search_one_group(struct ocfs2_alloc_context *ac,
1680 struct ocfs2_dinode *di = (struct ocfs2_dinode *)ac->ac_bh->b_data;
1681 struct inode *alloc_inode = ac->ac_inode;
1691 ret = ac->ac_group_search(alloc_inode, group_bh, bits_wanted, min_bits,
1692 ac->ac_max_block, res);
1700 ocfs2_bg_discontig_fix_result(ac, gd, res);
1708 if (ac->ac_find_loc_only)
1711 ret = ocfs2_alloc_dinode_update_counts(alloc_inode, handle, ac->ac_bh,
1733 static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1743 struct inode *alloc_inode = ac->ac_inode;
1746 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) ac->ac_bh->b_data;
1750 chain = ac->ac_chain;
1767 while ((status = ac->ac_group_search(alloc_inode, group_bh,
1769 ac->ac_max_block,
1801 ocfs2_bg_discontig_fix_result(ac, bg, res);
1822 if (ac->ac_allow_chain_relink &&
1826 ac->ac_bh, group_bh,
1834 if (ac->ac_find_loc_only)
1838 ac->ac_bh, res->sr_bits,
1870 static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
1879 u64 hint = ac->ac_last_group;
1885 BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted);
1886 BUG_ON(bits_wanted > (ac->ac_bits_wanted - ac->ac_bits_given));
1887 BUG_ON(!ac->ac_bh);
1889 fe = (struct ocfs2_dinode *) ac->ac_bh->b_data;
1897 ocfs2_error(ac->ac_inode->i_sb,
1913 status = ocfs2_search_one_group(ac, handle, bits_wanted,
1926 ac->ac_chain = victim;
1927 ac->ac_allow_chain_relink = 1;
1929 status = ocfs2_search_chain(ac, handle, bits_wanted, min_bits,
1947 ac->ac_allow_chain_relink = 0;
1954 ac->ac_chain = i;
1955 status = ocfs2_search_chain(ac, handle, bits_wanted, min_bits,
1973 ac->ac_last_group = 0;
1975 ac->ac_last_group = hint;
1984 struct ocfs2_alloc_context *ac,
1994 BUG_ON(!ac);
1995 BUG_ON(ac->ac_bits_wanted < (ac->ac_bits_given + bits_wanted));
1996 BUG_ON(ac->ac_which != OCFS2_AC_USE_META);
1998 status = ocfs2_claim_suballoc_bits(ac,
2007 atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs);
2012 ac->ac_bits_given += res.sr_bits;
2022 struct ocfs2_alloc_context *ac)
2036 OCFS2_I(dir)->ip_last_used_slot == ac->ac_alloc_slot)
2037 ac->ac_last_group = OCFS2_I(dir)->ip_last_used_group;
2038 else if (le16_to_cpu(di->i_suballoc_slot) == ac->ac_alloc_slot) {
2040 ac->ac_last_group = le64_to_cpu(di->i_suballoc_loc);
2042 ac->ac_last_group = ocfs2_which_suballoc_group(
2049 struct ocfs2_alloc_context *ac)
2051 OCFS2_I(dir)->ip_last_used_group = ac->ac_last_group;
2052 OCFS2_I(dir)->ip_last_used_slot = ac->ac_alloc_slot;
2057 struct ocfs2_alloc_context *ac,
2064 BUG_ON(!ac);
2065 BUG_ON(ac->ac_bits_given != 0);
2066 BUG_ON(ac->ac_bits_wanted != 1);
2067 BUG_ON(ac->ac_which != OCFS2_AC_USE_INODE);
2076 ocfs2_init_inode_ac_group(dir, parent_fe_bh, ac);
2095 ac->ac_find_loc_only = 1;
2097 ret = ocfs2_claim_suballoc_bits(ac, handle, 1, 1, res);
2103 ac->ac_find_loc_priv = res;
2118 struct ocfs2_alloc_context *ac,
2125 struct ocfs2_suballoc_result *res = ac->ac_find_loc_priv;
2128 struct ocfs2_dinode *di = (struct ocfs2_dinode *) ac->ac_bh->b_data;
2138 ret = ocfs2_read_group_descriptor(ac->ac_inode, di,
2148 ret = ocfs2_alloc_dinode_update_counts(ac->ac_inode, handle,
2149 ac->ac_bh, res->sr_bits,
2157 ac->ac_inode,
2170 atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs);
2176 ac->ac_bits_given++;
2177 ocfs2_save_inode_ac_group(dir, ac);
2188 struct ocfs2_alloc_context *ac,
2198 BUG_ON(!ac);
2199 BUG_ON(ac->ac_bits_given != 0);
2200 BUG_ON(ac->ac_bits_wanted != 1);
2201 BUG_ON(ac->ac_which != OCFS2_AC_USE_INODE);
2203 ocfs2_init_inode_ac_group(dir, parent_fe_bh, ac);
2205 status = ocfs2_claim_suballoc_bits(ac,
2214 atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs);
2221 ac->ac_bits_given++;
2222 ocfs2_save_inode_ac_group(dir, ac);
2291 struct ocfs2_alloc_context *ac,
2300 struct ocfs2_super *osb = OCFS2_SB(ac->ac_inode->i_sb);
2304 BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted);
2306 BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL
2307 && ac->ac_which != OCFS2_AC_USE_MAIN);
2309 if (ac->ac_which == OCFS2_AC_USE_LOCAL) {
2314 ac,
2334 status = ocfs2_claim_suballoc_bits(ac,
2342 ocfs2_desc_bitmap_to_cluster_off(ac->ac_inode,
2355 ac->ac_bits_given += *num_clusters;
2363 struct ocfs2_alloc_context *ac,
2368 unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
2370 return __ocfs2_claim_clusters(handle, ac, min_clusters,