• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/ocfs2/

Lines Matching refs:alloc

37 #include "alloc.h"
52 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc);
55 struct ocfs2_dinode *alloc,
58 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc);
62 struct ocfs2_dinode *alloc,
79 * Determine how large our local alloc window should be, in bits.
83 * through local alloc.
93 * Tell us whether a given allocation should use the local alloc
105 * allocations go through the local alloc, so allow an
116 struct ocfs2_dinode *alloc = NULL;
124 /* read the alloc off disk */
140 alloc = (struct ocfs2_dinode *) alloc_bh->b_data;
141 la = OCFS2_LOCAL_ALLOC(alloc);
143 if (!(le32_to_cpu(alloc->i_flags) &
145 mlog(ML_ERROR, "Invalid local alloc inode, %llu\n",
153 mlog(ML_ERROR, "Local alloc size is invalid (la_size = %u)\n",
160 num_used = ocfs2_local_alloc_count_bits(alloc);
162 /* hopefully the local alloc has always been recovered before
165 || alloc->id1.bitmap1.i_used
166 || alloc->id1.bitmap1.i_total
168 mlog(ML_ERROR, "Local alloc hasn't been recovered!\n"
170 num_used, le32_to_cpu(alloc->id1.bitmap1.i_used),
171 le32_to_cpu(alloc->id1.bitmap1.i_total),
172 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
204 struct ocfs2_dinode *alloc = NULL;
249 alloc = (struct ocfs2_dinode *) bh->b_data;
256 memcpy(alloc_copy, alloc, bh->b_size);
265 ocfs2_clear_local_alloc(alloc);
308 * alloc before giving up the recovered nodes journal. To solve this,
309 * we kmalloc a copy of the local alloc before it's change for the
319 struct ocfs2_dinode *alloc;
350 alloc = (struct ocfs2_dinode *) alloc_bh->b_data;
351 ocfs2_clear_local_alloc(alloc);
377 * a clean local alloc on disk and dropped the node out of the
382 struct ocfs2_dinode *alloc)
419 status = ocfs2_sync_local_to_main(osb, handle, alloc,
444 * local alloc. You lose them when you drop i_mutex.
454 struct ocfs2_dinode *alloc;
485 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
487 if (le32_to_cpu(alloc->id1.bitmap1.i_used) !=
488 ocfs2_local_alloc_count_bits(alloc)) {
489 ocfs2_error(osb->sb, "local alloc inode %llu says it has "
491 (unsigned long long)le64_to_cpu(alloc->i_blkno),
492 le32_to_cpu(alloc->id1.bitmap1.i_used),
493 ocfs2_local_alloc_count_bits(alloc));
498 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) -
499 le32_to_cpu(alloc->id1.bitmap1.i_used);
535 struct ocfs2_dinode *alloc;
543 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
544 la = OCFS2_LOCAL_ALLOC(alloc);
546 start = ocfs2_local_alloc_find_clear_bits(osb, alloc, bits_wanted);
556 /* local alloc is always contiguous by nature -- we never
571 alloc->id1.bitmap1.i_used = cpu_to_le32(*num_bits +
572 le32_to_cpu(alloc->id1.bitmap1.i_used));
586 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc)
591 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
604 struct ocfs2_dinode *alloc,
612 if (!alloc->id1.bitmap1.i_total) {
618 bitmap = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap;
622 left = le32_to_cpu(alloc->id1.bitmap1.i_total);
662 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc)
664 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
668 alloc->id1.bitmap1.i_total = 0;
669 alloc->id1.bitmap1.i_used = 0;
679 * sync the local alloc to main bitmap.
686 struct ocfs2_dinode *alloc,
695 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
698 le32_to_cpu(alloc->id1.bitmap1.i_total),
699 ocfs2_local_alloc_count_bits(alloc),
700 le32_to_cpu(alloc->id1.bitmap1.i_used));
702 if (!alloc->id1.bitmap1.i_total) {
707 if (le32_to_cpu(alloc->id1.bitmap1.i_used) ==
708 le32_to_cpu(alloc->id1.bitmap1.i_total)) {
717 left = le32_to_cpu(alloc->id1.bitmap1.i_total);
731 mlog(0, "freeing %u bits starting at local alloc bit "
802 struct ocfs2_dinode *alloc = NULL;
807 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
808 la = OCFS2_LOCAL_ALLOC(alloc);
810 if (alloc->id1.bitmap1.i_total)
811 mlog(0, "asking me to alloc a new window over a non-empty "
837 alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count);
842 alloc->id1.bitmap1.i_used = 0;
843 memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0,
848 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
849 mlog(0, "window bits = %u\n", le32_to_cpu(alloc->id1.bitmap1.i_total));
856 /* Note that we do *NOT* lock the local alloc inode here as
865 struct ocfs2_dinode *alloc;
890 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
892 /* We want to clear the local alloc before doing anything
894 * local alloc shutdown won't try to double free main bitmap
903 memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size);
913 ocfs2_clear_local_alloc(alloc);