summaryrefslogtreecommitdiffstats
path: root/source/locking/locking.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix debug message to show correct function name.Jeremy Allison2008-09-051-1/+1
| | | | Jeremy.
* Write times code update.Jeremy Allison2008-09-051-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ok, here's the fix for the write times breakage with the new tests in S4 smbtorture. The key is keeping in the share mode struct the "old_file_time" as the real write time, set by all the write and allocation calls, and the "changed_write_time" as the "sticky" write time - set by the SET_FILE_TIME calls. We can set them independently (although I kept the optimization of not setting the "old_file_time" is a "changed_write_time" was already set, as we'll never see it. This allows us to update the write time immediately on the SMBwrite truncate case, SET_END_OF_FILE and SET_ALLOCATION_SIZE calls, whilst still have the 2 second delay on the "normal" SMBwrite, SMBwriteX calls. I think in a subsequent patch I'd like to change the name of these from "old_file_time" to "write_time" and "changed_write_time" to "sticky_write_time" to make this clearer. I think I also fixed a bug in Metze's original code in that once a write timestamp had been set from a "normal" SMBwriteX call the fsp->update_write_time_triggered variable was set and then never reset - thus meaning the write timestamp would never get updated again on subsequent SMBwriteX's. The new code checks the update_write_time_event event instead, and doesn't update is there's an event already scheduled. Metze especially, please check this over for your understanding. Jeremy.
* Fix alignment problems on sparc, bug 5512Volker Lendecke2008-07-091-19/+20
| | | | | Patch successfully tested by Christoph Kaegi <kaph@zhaw.ch>, thanks. (cherry picked from commit 9f8df16f476c49da85000b7365c8a6e33b8b71fc)
* Allow server manager to close open files selected by id.Jeremy Allison2008-05-271-1/+1
| | | | Jeremy.
* Remove the "stat_open()" function, flag, and all associated code. It was onlyJeremy Allison2008-05-021-4/+0
| | | | | | | being (correctly) used in the can_read/can_write checks for hide unreadable/unwritable and this is more properly done using the functions in smbd/file_access.c. Preparing to do NT access checks on all file access. Jeremy.
* locking: combine get_delete_on_close_flag() and get_write_time() into ↵Stefan Metzmacher2008-04-071-19/+22
| | | | | | | | get_file_infos() This means we need to fetch the record only once. metze
* locking: store the write time in the locking.tdbStefan Metzmacher2008-04-071-14/+82
| | | | | | | | | This is needed to implement the strange write time update logic later. We need to store 2 time timestamps to distinguish between the time the file system had before the first client opened the file and a forced timestamp update. metze
* Merge leftovers of 0e1a86bc845 in 3-0-ctdbVolker Lendecke2008-03-171-4/+3
|
* Don't early delete the share mode tdb dataVolker Lendecke2008-01-121-2/+0
| | | | We now refer directly to the file name in the tdb data, so don't delete it.
* Trivial simplificationVolker Lendecke2008-01-121-5/+1
|
* Some more talloc_tos()Volker Lendecke2008-01-101-7/+7
|
* use talloc_tos in a few more placesVolker Lendecke2008-01-101-2/+2
|
* Do not talloc_strdup filename and servicepathVolker Lendecke2008-01-071-16/+8
|
* allocate share_mode_str only when neededVolker Lendecke2008-01-041-1/+4
|
* Tiny simplificationsVolker Lendecke2007-12-101-10/+14
| | | | | | locking.c:open_read_only was unused don't export the silly boolean flag locking_init(bool read_only)
* Remove a staticVolker Lendecke2007-12-101-11/+9
|
* Add a commentVolker Lendecke2007-11-181-1/+7
|
* Fix a valgrind errorVolker Lendecke2007-11-181-3/+4
|
* Add MAX_DNS_NAME_LENGTH, remove more pstrings.Jeremy Allison2007-11-151-9/+9
| | | | Jeremy.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-26/+26
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* r25055: Add file_id_string_tosVolker Lendecke2007-10-101-2/+2
| | | | This removes file_id_string_static and file_id_string_static2
* r24266: Remove the "open files database hash size" parameterVolker Lendecke2007-10-101-2/+1
| | | | This has been superseded by the "tdb_hashsize:<tdbname>" parameter
* r24117: use locking_key() instead of forming the TDB_DATA keyStefan Metzmacher2007-10-101-4/+1
| | | | | | by hand metze
* r23956: merge from 3_2-ctdb-tridge:Stefan Metzmacher2007-10-101-0/+8
| | | | | | | | fixed a bug with dead share mode entries jra: please tell me if it's ok to merge this to 3_2_0. metze
* r23908: Fix bug with interaction of optimization withJeremy Allison2007-10-101-8/+24
| | | | | | POSIX locking. We can't do lock counts with POSIX, so stop counting if we get a POSIX lock request. Jeremy.
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach2007-10-101-12/+12
| | | | failed expression in SMB_ASSERT.
* r23486: Ok, this time with a hopefully successful make test in the right place:Volker Lendecke2007-10-101-4/+0
| | | | Remove two local variables
* r23222: share_mode_forall() is only for counting and status display stuff, soVolker Lendecke2007-10-101-1/+1
| | | | traverse_read is enough here
* r23183: Check in a change made by Tridge:Volker Lendecke2007-10-101-51/+35
| | | | | | | | | | | | | This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker
* r23164: Minor cosmetic checkinVolker Lendecke2007-10-101-2/+2
|
* r23163: Convert locking.tdb to dbwrapVolker Lendecke2007-10-101-91/+109
|
* r23162: Make use of messaging_send_bufVolker Lendecke2007-10-101-4/+2
|
* r23100: Implement the delete on close semantics I've just tested forJeremy Allison2007-10-101-1/+45
| | | | | | in Samba4 smbtorture. Fix rename on an open file handle. Needed for 3.0.25a. Jeremy.
* r23014: For all branches, ensure that if we're blocked on a POSIXJeremy Allison2007-10-101-2/+4
| | | | | | | | lock we know nothing about that we retry the lock every 10 seconds instead of waiting for the standard select timeout. This is how we used to (and are supposed to) work. Jeremy.
* r22846: Chunk one to replace message_send_pid with messaging_send: Deep insideVolker Lendecke2007-10-101-9/+17
| | | | | | locking/locking.c we have to send retry messages to timed lock holders. The majority of this patch passes a "struct messaging_context" down there. No functional change, survives make test.
* r22542: Move over to using the _strict varients of the tallocJeremy Allison2007-10-101-1/+1
| | | | | calls. No functional changes. Looks bigger than it is :-). Jeremy.
* r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher2007-10-101-10/+10
| | | | | | and fix all compiler warnings in the users metze
* r21726: Fix stupid cut-n-paste typo. Thanks to volker forJeremy Allison2007-10-101-1/+1
| | | | | being on the ball..... :-). Jeremy.
* r21724: Optimization pointed out by Volker. If we don'tJeremy Allison2007-10-101-0/+20
| | | | | | have any outstanding locks or blocking locks then we don't need to read the lock db. on close. Jeremy.
* r21723: Make use of the per-hashchain "freelists"Volker Lendecke2007-10-101-0/+3
|
* r21706: get_delete_on_close_flag() is the perfect candidate for ↵Volker Lendecke2007-10-101-7/+21
| | | | tdb_parse_record()
* r21257: Better fix for bug #4188 :Jeremy Allison2007-10-101-36/+1
| | | | | | Windows Vista RC1 and RC2 can't delete directory on Samba share based on work by Joe Meadows <jmeadows@webopolis.com>. Jeremy.
* r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison2007-10-101-3/+6
| | | | | | | | Move more error code returns to NTSTATUS. Client test code to follow... See if this passes the build-farm before I add it into 3.0.25. Jeremy.
* r20916: Add in the delete on close final fix - but only enabledJeremy Allison2007-10-101-0/+4
| | | | | with -DDEVELOPER. Jeremy.
* r20883: W00t! I now understand how "delete on close" reallyJeremy Allison2007-10-101-23/+16
| | | | | | | | | | | | | | | | works - even with the strange "initial delete on close" semantics. The "initial delete on close" flag isn't committed to the share mode db until the handle is closed, and is discarded if any real "delete on close" was set. This allows me to remove the "initial_delete_on_close" flag from the share db, and move it into a BOOL in files_struct. Warning ! You must do a make clean after this. Cope with the wrinkle in directory delete on close which is done differently from files. We now pass all Samba4 smbtortute BASE-DELETE tests except for the one checking that files can't be created in a directory which has the delete on close set (possibly expensive to fix). Jeremy.
* r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.Jeremy Allison2007-10-101-0/+40
| | | | | | | | Allow us to correctly refuse to set delete on close on a non-empty directory. There are still some delete-on-close wrinkles to be fixed, but I understand how to do that better now. I'll fix this tomorrow. Jeremy.
* r19668: Convert the locking params to use struct share_param instead of snumVolker Lendecke2007-10-101-8/+7
|
* r19078: talloc_strdup can failVolker Lendecke2007-10-101-0/+6
|