+ if (inode->i_size == 0 || *offset>= inode->i_size) {Why not using if (*offset>= inode->i_size) directly?
+ ret = -ENXIO;
+ goto out_unlock;
+ }
+ BUG_ON(cpos< le32_to_cpu(rec.e_cpos));
A same assert has already been performed inside ocfs2_get_clusters_nocache(),
does it make sense to do it again here?
+Seems above logic is going to stop at the first time we find a hole.
+ if ((!is_data&& origin == SEEK_HOLE) ||
+ (is_data&& origin == SEEK_DATA)) {
+ if (extoff> *offset)
+ *offset = extoff;
+ goto out_unlock;
How about the offset was within the range of a hole already when we doing
SEEK_HOLE, shouldn't we proceed detecting until the next hole gets found, whose
start_offset was greater than supplied offset, according to semantics described
by the the header of this patch, should it be like following?
if (extoff> *offset) {
*offset = extoff;
goto out_unlock;
}
+ if (origin == SEEK_HOLE) {extoff already has been assigned properly above in while loop?
+ extoff = cpos;
+ extoff<<= cs_bits;