Ignore:
Timestamp:
May 27, 2009, 9:09:42 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/locking/locking.c

    r204 r232  
    10681068
    10691069void 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)
    10711071{
    10721072        struct share_mode_entry entry;
    10731073        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         }
    10771074        add_share_mode_entry(lck, &entry);
    10781075}
     
    11901187
    11911188        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        }
    11931199        lck->modified = True;
    11941200        return True;
     
    12701276
    12711277        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;
    12881278}
    12891279
     
    13851375}
    13861376
    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 
    14121377bool set_sticky_write_time(struct file_id fileid, struct timespec write_time)
    14131378{
Note: See TracChangeset for help on using the changeset viewer.