ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.c
(Generate patch)

Comparing libeio/eio.c (file contents):
Revision 1.9 by root, Mon May 12 00:31:43 2008 UTC vs.
Revision 1.10 by root, Tue May 13 17:08:15 2008 UTC

1065 { \ 1065 { \
1066 eio_api_destroy (req); \ 1066 eio_api_destroy (req); \
1067 return 0; \ 1067 return 0; \
1068 } 1068 }
1069 1069
1070eio_req *eio_nop (eio_cb cb) 1070eio_req *eio_nop (int pri, eio_cb cb, void *data)
1071{ 1071{
1072 REQ (EIO_NOP); SEND; 1072 REQ (EIO_NOP); SEND;
1073} 1073}
1074 1074
1075eio_req *eio_busy (double delay, eio_cb cb) 1075eio_req *eio_busy (double delay, int pri, eio_cb cb, void *data)
1076{ 1076{
1077 REQ (EIO_BUSY); req->nv1 = delay; SEND; 1077 REQ (EIO_BUSY); req->nv1 = delay; SEND;
1078} 1078}
1079 1079
1080eio_req *eio_sync (eio_cb cb) 1080eio_req *eio_sync (int pri, eio_cb cb, void *data)
1081{ 1081{
1082 REQ (EIO_SYNC); SEND; 1082 REQ (EIO_SYNC); SEND;
1083} 1083}
1084 1084
1085eio_req *eio_fsync (int fd, eio_cb cb) 1085eio_req *eio_fsync (int fd, int pri, eio_cb cb, void *data)
1086{ 1086{
1087 REQ (EIO_FSYNC); req->int1 = fd; SEND; 1087 REQ (EIO_FSYNC); req->int1 = fd; SEND;
1088} 1088}
1089 1089
1090eio_req *eio_fdatasync (int fd, eio_cb cb) 1090eio_req *eio_fdatasync (int fd, int pri, eio_cb cb, void *data)
1091{ 1091{
1092 REQ (EIO_FDATASYNC); req->int1 = fd; SEND; 1092 REQ (EIO_FDATASYNC); req->int1 = fd; SEND;
1093} 1093}
1094 1094
1095eio_req *eio_close (int fd, eio_cb cb) 1095eio_req *eio_close (int fd, int pri, eio_cb cb, void *data)
1096{ 1096{
1097 REQ (EIO_CLOSE); req->int1 = fd; SEND; 1097 REQ (EIO_CLOSE); req->int1 = fd; SEND;
1098} 1098}
1099 1099
1100eio_req *eio_readahead (int fd, off_t offset, size_t length, eio_cb cb) 1100eio_req *eio_readahead (int fd, off_t offset, size_t length, int pri, eio_cb cb, void *data)
1101{ 1101{
1102 REQ (EIO_READAHEAD); req->int1 = fd; req->offs = offset; req->size = length; SEND; 1102 REQ (EIO_READAHEAD); req->int1 = fd; req->offs = offset; req->size = length; SEND;
1103} 1103}
1104 1104
1105eio_req *eio_read (int fd, void *data, size_t length, off_t offset, eio_cb cb) 1105eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data)
1106{ 1106{
1107 REQ (EIO_READ); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = data; SEND; 1107 REQ (EIO_READ); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = buf; SEND;
1108} 1108}
1109 1109
1110eio_req *eio_write (int fd, void *data, size_t length, off_t offset, eio_cb cb) 1110eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data)
1111{ 1111{
1112 REQ (EIO_WRITE); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = data; SEND; 1112 REQ (EIO_WRITE); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = buf; SEND;
1113} 1113}
1114 1114
1115eio_req *eio_fstat (int fd, eio_cb cb) 1115eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data)
1116{ 1116{
1117 REQ (EIO_FSTAT); req->int1 = fd; SEND; 1117 REQ (EIO_FSTAT); req->int1 = fd; SEND;
1118} 1118}
1119 1119
1120eio_req *eio_futime (int fd, double atime, double mtime, eio_cb cb) 1120eio_req *eio_futime (int fd, double atime, double mtime, int pri, eio_cb cb, void *data)
1121{ 1121{
1122 REQ (EIO_FUTIME); req->int1 = fd; req->nv1 = atime; req->nv2 = mtime; SEND; 1122 REQ (EIO_FUTIME); req->int1 = fd; req->nv1 = atime; req->nv2 = mtime; SEND;
1123} 1123}
1124 1124
1125eio_req *eio_ftruncate (int fd, off_t offset, eio_cb cb) 1125eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data)
1126{ 1126{
1127 REQ (EIO_FTRUNCATE); req->int1 = fd; req->offs = offset; SEND; 1127 REQ (EIO_FTRUNCATE); req->int1 = fd; req->offs = offset; SEND;
1128} 1128}
1129 1129
1130eio_req *eio_fchmod (int fd, mode_t mode, eio_cb cb) 1130eio_req *eio_fchmod (int fd, mode_t mode, int pri, eio_cb cb, void *data)
1131{ 1131{
1132 REQ (EIO_FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND; 1132 REQ (EIO_FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND;
1133} 1133}
1134 1134
1135eio_req *eio_fchown (int fd, uid_t uid, gid_t gid, eio_cb cb) 1135eio_req *eio_fchown (int fd, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data)
1136{ 1136{
1137 REQ (EIO_FCHOWN); req->int1 = fd; req->int2 = (long)uid; req->int3 = (long)gid; SEND; 1137 REQ (EIO_FCHOWN); req->int1 = fd; req->int2 = (long)uid; req->int3 = (long)gid; SEND;
1138} 1138}
1139 1139
1140eio_req *eio_dup2 (int fd, int fd2, eio_cb cb) 1140eio_req *eio_dup2 (int fd, int fd2, int pri, eio_cb cb, void *data)
1141{ 1141{
1142 REQ (EIO_DUP2); req->int1 = fd; req->int2 = fd2; SEND; 1142 REQ (EIO_DUP2); req->int1 = fd; req->int2 = fd2; SEND;
1143} 1143}
1144 1144
1145eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, eio_cb cb) 1145eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, int pri, eio_cb cb, void *data)
1146{ 1146{
1147 REQ (EIO_SENDFILE); req->int1 = out_fd; req->int2 = in_fd; req->offs = in_offset; req->size = length; SEND; 1147 REQ (EIO_SENDFILE); req->int1 = out_fd; req->int2 = in_fd; req->offs = in_offset; req->size = length; SEND;
1148} 1148}
1149 1149
1150eio_req *eio_open (const char *path, int flags, mode_t mode, eio_cb cb) 1150eio_req *eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data)
1151{ 1151{
1152 REQ (EIO_OPEN); PATH; req->int1 = flags; req->int2 = (long)mode; SEND; 1152 REQ (EIO_OPEN); PATH; req->int1 = flags; req->int2 = (long)mode; SEND;
1153} 1153}
1154 1154
1155eio_req *eio_utime (const char *path, double atime, double mtime, eio_cb cb) 1155eio_req *eio_utime (const char *path, double atime, double mtime, int pri, eio_cb cb, void *data)
1156{ 1156{
1157 REQ (EIO_UTIME); PATH; req->nv1 = atime; req->nv2 = mtime; SEND; 1157 REQ (EIO_UTIME); PATH; req->nv1 = atime; req->nv2 = mtime; SEND;
1158} 1158}
1159 1159
1160eio_req *eio_truncate (const char *path, off_t offset, eio_cb cb) 1160eio_req *eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data)
1161{ 1161{
1162 REQ (EIO_TRUNCATE); PATH; req->offs = offset; SEND; 1162 REQ (EIO_TRUNCATE); PATH; req->offs = offset; SEND;
1163} 1163}
1164 1164
1165eio_req *eio_chown (const char *path, uid_t uid, gid_t gid, eio_cb cb) 1165eio_req *eio_chown (const char *path, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data)
1166{ 1166{
1167 REQ (EIO_CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND; 1167 REQ (EIO_CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND;
1168} 1168}
1169 1169
1170eio_req *eio_chmod (const char *path, mode_t mode, eio_cb cb) 1170eio_req *eio_chmod (const char *path, mode_t mode, int pri, eio_cb cb, void *data)
1171{ 1171{
1172 REQ (EIO_CHMOD); PATH; req->int2 = (long)mode; SEND; 1172 REQ (EIO_CHMOD); PATH; req->int2 = (long)mode; SEND;
1173} 1173}
1174 1174
1175eio_req *eio_mkdir (const char *path, mode_t mode, eio_cb cb) 1175eio_req *eio_mkdir (const char *path, mode_t mode, int pri, eio_cb cb, void *data)
1176{ 1176{
1177 REQ (EIO_MKDIR); PATH; req->int2 = (long)mode; SEND; 1177 REQ (EIO_MKDIR); PATH; req->int2 = (long)mode; SEND;
1178} 1178}
1179 1179
1180static eio_req * 1180static eio_req *
1181eio__1path (int type, const char *path, eio_cb cb) 1181eio__1path (int type, const char *path, int pri, eio_cb cb, void *data)
1182{ 1182{
1183 REQ (type); PATH; SEND; 1183 REQ (type); PATH; SEND;
1184} 1184}
1185 1185
1186eio_req *eio_readlink (const char *path, eio_cb cb) 1186eio_req *eio_readlink (const char *path, int pri, eio_cb cb, void *data)
1187{ 1187{
1188 return eio__1path (EIO_READLINK, path, cb); 1188 return eio__1path (EIO_READLINK, path, pri, cb, data);
1189} 1189}
1190 1190
1191eio_req *eio_stat (const char *path, eio_cb cb) 1191eio_req *eio_stat (const char *path, int pri, eio_cb cb, void *data)
1192{ 1192{
1193 return eio__1path (EIO_STAT, path, cb); 1193 return eio__1path (EIO_STAT, path, pri, cb, data);
1194} 1194}
1195 1195
1196eio_req *eio_lstat (const char *path, eio_cb cb) 1196eio_req *eio_lstat (const char *path, int pri, eio_cb cb, void *data)
1197{ 1197{
1198 return eio__1path (EIO_LSTAT, path, cb); 1198 return eio__1path (EIO_LSTAT, path, pri, cb, data);
1199} 1199}
1200 1200
1201eio_req *eio_unlink (const char *path, eio_cb cb) 1201eio_req *eio_unlink (const char *path, int pri, eio_cb cb, void *data)
1202{ 1202{
1203 return eio__1path (EIO_UNLINK, path, cb); 1203 return eio__1path (EIO_UNLINK, path, pri, cb, data);
1204} 1204}
1205 1205
1206eio_req *eio_rmdir (const char *path, eio_cb cb) 1206eio_req *eio_rmdir (const char *path, int pri, eio_cb cb, void *data)
1207{ 1207{
1208 return eio__1path (EIO_RMDIR, path, cb); 1208 return eio__1path (EIO_RMDIR, path, pri, cb, data);
1209} 1209}
1210 1210
1211eio_req *eio_readdir (const char *path, eio_cb cb) 1211eio_req *eio_readdir (const char *path, int pri, eio_cb cb, void *data)
1212{ 1212{
1213 return eio__1path (EIO_READDIR, path, cb); 1213 return eio__1path (EIO_READDIR, path, pri, cb, data);
1214} 1214}
1215 1215
1216eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, eio_cb cb) 1216eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, int pri, eio_cb cb, void *data)
1217{ 1217{
1218 REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->int2 = (long)dev; SEND; 1218 REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->int2 = (long)dev; SEND;
1219} 1219}
1220 1220
1221static eio_req * 1221static eio_req *
1222eio__2path (int type, const char *path, const char *new_path, eio_cb cb) 1222eio__2path (int type, const char *path, const char *new_path, int pri, eio_cb cb, void *data)
1223{ 1223{
1224 REQ (type); PATH; 1224 REQ (type); PATH;
1225 1225
1226 req->flags |= EIO_FLAG_PTR2_FREE; 1226 req->flags |= EIO_FLAG_PTR2_FREE;
1227 req->ptr2 = strdup (new_path); 1227 req->ptr2 = strdup (new_path);
1232 } 1232 }
1233 1233
1234 SEND; 1234 SEND;
1235} 1235}
1236 1236
1237eio_req *eio_link (const char *path, const char *new_path, eio_cb cb) 1237eio_req *eio_link (const char *path, const char *new_path, int pri, eio_cb cb, void *data)
1238{ 1238{
1239 return eio__2path (EIO_LINK, path, new_path, cb); 1239 return eio__2path (EIO_LINK, path, new_path, pri, cb, data);
1240} 1240}
1241 1241
1242eio_req *eio_symlink (const char *path, const char *new_path, eio_cb cb) 1242eio_req *eio_symlink (const char *path, const char *new_path, int pri, eio_cb cb, void *data)
1243{ 1243{
1244 return eio__2path (EIO_SYMLINK, path, new_path, cb); 1244 return eio__2path (EIO_SYMLINK, path, new_path, pri, cb, data);
1245} 1245}
1246 1246
1247eio_req *eio_rename (const char *path, const char *new_path, eio_cb cb) 1247eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data)
1248{ 1248{
1249 return eio__2path (EIO_RENAME, path, new_path, cb); 1249 return eio__2path (EIO_RENAME, path, new_path, pri, cb, data);
1250}
1251
1252eio_req *eio_grp (eio_cb cb, void *data)
1253{
1254 const int pri = EIO_PRI_MAX;
1255
1256 REQ (EIO_GROUP); SEND;
1250} 1257}
1251 1258
1252#undef REQ 1259#undef REQ
1253#undef PATH 1260#undef PATH
1254#undef SEND 1261#undef SEND

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines