diff options
author | Volker Lendecke <vl@samba.org> | 2009-11-16 09:40:47 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-11-21 11:40:13 +0100 |
commit | f0a933d1408678fabc856e89a5aaebb792047de3 (patch) | |
tree | a6740c2d9bcd89d3dbec413d681eaef9561dd014 /source3/include | |
parent | bda1c701f418d3263d36714f9b646ab60ea2da0f (diff) | |
download | samba-f0a933d1408678fabc856e89a5aaebb792047de3.tar.gz samba-f0a933d1408678fabc856e89a5aaebb792047de3.tar.bz2 samba-f0a933d1408678fabc856e89a5aaebb792047de3.zip |
s3: Cache brlock.tdb entries for the fast read&write strict locking code path
For a netbench run this gains around 2% user-space CPU, fetching a 100MB file
takes around 4% less.
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/proto.h | 3 | ||||
-rw-r--r-- | source3/include/smb.h | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index cad8651974..feeac59004 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3428,8 +3428,7 @@ int brl_forall(void (*fn)(struct file_id id, struct server_id pid, void *private_data); struct byte_range_lock *brl_get_locks(TALLOC_CTX *mem_ctx, files_struct *fsp); -struct byte_range_lock *brl_get_locks_readonly(TALLOC_CTX *mem_ctx, - files_struct *fsp); +struct byte_range_lock *brl_get_locks_readonly(files_struct *fsp); void brl_register_msgs(struct messaging_context *msg_ctx); /* The following definitions come from locking/locking.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 2ff60f6c44..a3acb7c415 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -461,6 +461,14 @@ typedef struct files_struct { struct files_struct *base_fsp; /* placeholder for delete on close */ + /* + * Read-only cached brlock record, thrown away when the + * brlock.tdb seqnum changes. This avoids fetching data from + * the brlock.tdb on every read/write call. + */ + int brlock_seqnum; + struct byte_range_lock *brlock_rec; + struct dptr_struct *dptr; } files_struct; |