Changeset 232 for branches/samba-3.2.x/source/locking/locking.c
- Timestamp:
- May 27, 2009, 9:09:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/locking/locking.c
r204 r232 1068 1068 1069 1069 void set_share_mode(struct share_mode_lock *lck, files_struct *fsp, 1070 uid_t uid, uint16 mid, uint16 op_type, bool initial_delete_on_close_allowed)1070 uid_t uid, uint16 mid, uint16 op_type) 1071 1071 { 1072 1072 struct share_mode_entry entry; 1073 1073 fill_share_mode_entry(&entry, fsp, uid, mid, op_type); 1074 if (initial_delete_on_close_allowed) {1075 entry.flags |= SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE;1076 }1077 1074 add_share_mode_entry(lck, &entry); 1078 1075 } … … 1190 1187 1191 1188 e->op_mid = 0; 1192 e->op_type = NO_OPLOCK; 1189 if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) { 1190 /* 1191 * Going from exclusive or batch, 1192 * we always go through FAKE_LEVEL_II 1193 * first. 1194 */ 1195 e->op_type = FAKE_LEVEL_II_OPLOCK; 1196 } else { 1197 e->op_type = NO_OPLOCK; 1198 } 1193 1199 lck->modified = True; 1194 1200 return True; … … 1270 1276 1271 1277 return NT_STATUS_OK; 1272 }1273 1274 /****************************************************************************1275 Do we have an open file handle that created this entry ?1276 ****************************************************************************/1277 1278 bool can_set_initial_delete_on_close(const struct share_mode_lock *lck)1279 {1280 int i;1281 1282 for (i=0; i<lck->num_share_modes; i++) {1283 if (lck->share_modes[i].flags & SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE) {1284 return True;1285 }1286 }1287 return False;1288 1278 } 1289 1279 … … 1385 1375 } 1386 1376 1387 /****************************************************************************1388 Sets the allow initial delete on close flag for this share mode.1389 ****************************************************************************/1390 1391 bool set_allow_initial_delete_on_close(struct share_mode_lock *lck, files_struct *fsp, bool delete_on_close)1392 {1393 struct share_mode_entry entry, *e;1394 1395 /* Don't care about the pid owner being correct here - just a search. */1396 fill_share_mode_entry(&entry, fsp, (uid_t)-1, 0, NO_OPLOCK);1397 1398 e = find_share_mode_entry(lck, &entry);1399 if (e == NULL) {1400 return False;1401 }1402 1403 if (delete_on_close) {1404 e->flags |= SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE;1405 } else {1406 e->flags &= ~SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE;1407 }1408 lck->modified = True;1409 return True;1410 }1411 1412 1377 bool set_sticky_write_time(struct file_id fileid, struct timespec write_time) 1413 1378 {
Note:
See TracChangeset
for help on using the changeset viewer.