size of the record */
struct lock_struct {
struct lock_context context;
- uint16_t fnum;
+ struct ntvfs_handle *ntvfs;
uint64_t start;
uint64_t size;
enum brl_type lock_type;
/* this struct is attached to on oprn file handle */
struct brl_handle {
DATA_BLOB key;
- uint16_t fnum;
+ struct ntvfs_handle *ntvfs;
struct lock_struct last_lock;
};
return brl;
}
-struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, DATA_BLOB *file_key, uint16_t fnum)
+struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)
{
struct brl_handle *brlh;
}
brlh->key = *file_key;
- brlh->fnum = fnum;
+ brlh->ntvfs = ntvfs;
ZERO_STRUCT(brlh->last_lock);
return brlh;
}
if (brl_same_context(&lck1->context, &lck2->context) &&
- lck2->lock_type == READ_LOCK && lck1->fnum == lck2->fnum) {
+ lck2->lock_type == READ_LOCK && lck1->ntvfs == lck2->ntvfs) {
return False;
}
* in smbtorture.
*/
if (brl_same_context(&lck1->context, &lck2->context) &&
- lck1->fnum == lck2->fnum &&
+ lck1->ntvfs == lck2->ntvfs &&
(lck2->lock_type == READ_LOCK || lck1->lock_type == WRITE_LOCK)) {
return False;
}
*/
if (lock->context.server == brlh->last_lock.context.server &&
lock->context.ctx == brlh->last_lock.context.ctx &&
- lock->fnum == brlh->last_lock.fnum &&
+ lock->ntvfs == brlh->last_lock.ntvfs &&
lock->start == brlh->last_lock.start) {
return NT_STATUS_FILE_LOCK_CONFLICT;
}
lock.context.smbpid = smbpid;
lock.context.server = brl->server;
lock.context.ctx = brl;
- lock.fnum = brlh->fnum;
+ lock.ntvfs = brlh->ntvfs;
lock.context.ctx = brl;
lock.start = start;
lock.size = size;
struct lock_struct *lock = &locks[i];
if (brl_same_context(&lock->context, &context) &&
- lock->fnum == brlh->fnum &&
+ lock->ntvfs == brlh->ntvfs &&
lock->start == start &&
lock->size == size &&
lock->lock_type < PENDING_READ_LOCK) {
lock.context.smbpid = smbpid;
lock.context.server = brl->server;
lock.context.ctx = brl;
- lock.fnum = brlh->fnum;
+ lock.ntvfs = brlh->ntvfs;
lock.start = start;
lock.size = size;
lock.lock_type = lock_type;
if (lock->context.ctx == brl &&
lock->context.server == brl->server &&
- lock->fnum == brlh->fnum) {
+ lock->ntvfs == brlh->ntvfs) {
/* found it - delete it */
if (count > 1 && i < count-1) {
memmove(&locks[i], &locks[i+1],