[stgt] [PATCH 07/15] tgt: os.h: sync_file_range is OS dependent

Or Gerlitz ogerlitz at voltaire.com
Tue Mar 3 07:58:06 CET 2009


FUJITA Tomonori wrote:
> I don't think any functions in linux/os.c is a fast-path call. I really don't think that making sync_file_range inline affects the performance.
>   
OK, let it be. As for fast path, sync_fine_range is called from 
bs_rdwr_request() but I wasn't sure what is the exact condition for 
doing so, should it be done for each write?
>         case WRITE_6:
> 	case WRITE_10:
> 	case WRITE_12:
> 	case WRITE_16:
> 		length = scsi_get_out_length(cmd);
> 		ret = pwrite64(fd, scsi_get_out_buffer(cmd), length,
> 			       cmd->offset);
> 		if (ret == length) {
> 			/*
> 			 * it would be better not to access to pg
> 			 * directy.
> 			 */
> 			struct mode_pg *pg = cmd->dev->mode_pgs[0x8];
>
> 			if (((cmd->scb[0] != WRITE_6) && (cmd->scb[1] & 0x8)) ||
> 			    !(pg->mode_data[0] & 0x04))
> 				bs_sync_sync_range(cmd, length, &result, &key,
> 						   &asc);
> 		} else
> 			set_medium_error(&result, &key, &asc);


> As I suggested, we compile bs_aio.o only with Linux. It makes sense because bs_aio is Linux specific AIO code.
>   
OK, understood.


Or

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list