Changes in uspace/srv/fs/mfs/mfs_rw.c [7a46bfe:36cb22f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_rw.c
r7a46bfe r36cb22f 31 31 */ 32 32 33 #include <align.h> 33 34 #include "mfs.h" 34 35 … … 53 54 *bytes, this function returns the on-disk block 54 55 *relative to that position. 55 *Returns zero if the block does not exist. 56 * 57 * @param b Pointer to a 32bit number where the block number will be stored 58 * @param mnode Pointer to a generic MINIX inode in memory. 59 * @param pos Position in file. 60 * 61 * @return EOK on success or a negative error code. 56 62 */ 57 63 int … … 65 71 int rblock = pos / block_size; 66 72 67 if ( mnode->ino_i->i_size< pos) {73 if (ROUND_UP(mnode->ino_i->i_size, sbi->block_size) < pos) { 68 74 /*Trying to read beyond the end of file*/ 69 75 r = EOK; … … 227 233 } 228 234 229 /*Free unused indirect zones*/ 235 /**Free unused indirect zones from a MINIX inode according to it's new size. 236 * 237 * @param mnode Pointer to a generic MINIX inode in memory. 238 * @param new_size The new size of the inode. 239 * 240 * @return EOK on success or a negative error code. 241 */ 230 242 int 231 243 mfs_prune_ind_zones(struct mfs_node *mnode, size_t new_size) … … 239 251 mfs_version_t fs_version = sbi->fs_version; 240 252 253 assert(new_size <= ino_i->i_size); 254 241 255 if (fs_version == MFS_VERSION_V1) { 242 256 nr_direct = V1_NR_DIRECT_ZONES;
Note:
See TracChangeset
for help on using the changeset viewer.