Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3540 → Rev 3542

/trunk/uspace/lib/libblock/libblock.c
358,7 → 358,7
*
* @return Block structure.
*/
block_t *block_get(dev_handle_t dev_handle, off_t boff, size_t bs)
block_t *block_get(dev_handle_t dev_handle, off_t boff)
{
devcon_t *devcon;
cache_t *cache;
/trunk/uspace/lib/libblock/libblock.h
75,7 → 75,7
 
extern int block_cache_init(dev_handle_t, size_t, unsigned);
 
extern block_t *block_get(dev_handle_t, off_t, size_t);
extern block_t *block_get(dev_handle_t, off_t);
extern void block_put(block_t *);
 
extern int block_read(int, off_t *, size_t *, off_t *, void *, size_t, size_t);
/trunk/uspace/srv/fs/fat/fat_fat.c
95,7 → 95,7
if (firstc == FAT_CLST_ROOT) {
/* root directory special case */
assert(offset < rds);
b = block_get(dev_handle, rscnt + fatcnt * sf + offset, bps);
b = block_get(dev_handle, rscnt + fatcnt * sf + offset);
return b;
}
 
108,7 → 108,7
fsec = (clst * sizeof(fat_cluster_t)) / bps;
fidx = clst % (bps / sizeof(fat_cluster_t));
/* read FAT1 */
b = block_get(dev_handle, rscnt + fsec, bps);
b = block_get(dev_handle, rscnt + fsec);
clst = uint16_t_le2host(((fat_cluster_t *)b->data)[fidx]);
assert(clst != FAT_CLST_BAD);
assert(clst < FAT_CLST_LAST1);
116,7 → 116,7
}
 
b = block_get(dev_handle, ssa + (clst - FAT_CLST_FIRST) * spc +
offset % spc, bps);
offset % spc);
 
return b;
}
163,7 → 163,7
fsec = (clst * sizeof(fat_cluster_t)) / bps;
fidx = clst % (bps / sizeof(fat_cluster_t));
/* read FAT1 */
b = block_get(dev_handle, rscnt + fsec, bps);
b = block_get(dev_handle, rscnt + fsec);
clst = uint16_t_le2host(((fat_cluster_t *)b->data)[fidx]);
assert(clst != FAT_CLST_BAD);
block_put(b);
243,7 → 243,7
 
assert(fatno < bs->fatcnt);
b = block_get(dev_handle, rscnt + sf * fatno +
(clst * sizeof(fat_cluster_t)) / bps, bps);
(clst * sizeof(fat_cluster_t)) / bps);
cp = (fat_cluster_t *)b->data + clst % (bps / sizeof(fat_cluster_t));
*cp = host2uint16_t_le(value);
b->dirty = true; /* need to sync block */
313,7 → 313,7
*/
futex_down(&fat_alloc_lock);
for (b = 0, cl = 0; b < sf; blk++) {
blk = block_get(dev_handle, rscnt + b, bps);
blk = block_get(dev_handle, rscnt + b);
for (c = 0; c < bps / sizeof(fat_cluster_t); c++, cl++) {
fat_cluster_t *clst = (fat_cluster_t *)blk->data + c;
if (uint16_t_le2host(*clst) == FAT_CLST_RES0) {