diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-10-20 08:46:00 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-10-20 08:46:00 +0000 |
commit | 3e670e4057321911c6674b8abe3c0bdcd684fd09 (patch) | |
tree | 7cafae87caec23475f42da2a0961dd939ec5f905 /source3/include/proto.h | |
parent | f4b4b3e6e35916dc5e280542f5f914e40b25dd21 (diff) | |
download | samba-3e670e4057321911c6674b8abe3c0bdcd684fd09.tar.gz samba-3e670e4057321911c6674b8abe3c0bdcd684fd09.tar.bz2 samba-3e670e4057321911c6674b8abe3c0bdcd684fd09.zip |
a major share modes reorganisation.
The shares modes code is now split into separate files. The shared
memory implementation is in locking_shm.c. The slow implementation is
in locking_slow.c
It is all controlled by a struct share_ops structure that has function
pointers to the implementation of all the functions needed by a share
modes implementation. An initialisation function sets up this
structure. This will make adding new implementations easy and clean.
This also allowed me to get rid of the ugly code in smbstatus. Now
status.c links to the locking code and calls methods in share_ops.
I also renamed some things and generally organised things in a much
cleaner fashion. Defines and structures specific to each
implementation have been moved to the appropriate file and out of
smb.h.
(This used to be commit 65ab9adaa0d356b8041ed8a507ea52117f2a284e)
Diffstat (limited to 'source3/include/proto.h')
-rw-r--r-- | source3/include/proto.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 224aaa5a79..024917a0d8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -305,22 +305,25 @@ int lp_minor_announce_version(void); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL start_share_mode_mgmt(void); -BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, share_lock_token token); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, share_lock_token token); +BOOL locking_init(void); +BOOL locking_end(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); +int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, + share_mode_entry **shares); +void del_share_mode(int token, int fnum); +BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); +BOOL remove_share_oplock(int fnum, int token); +int share_mode_forall(void (*fn)(share_mode_entry *, char *)); +void share_status(FILE *f); + +/*The following definitions come from locking_shm.c */ + +struct share_ops *locking_shm_init(void); + +/*The following definitions come from locking_slow.c */ + +struct share_ops *locking_slow_init(void); /*The following definitions come from lsaparse.c */ @@ -778,7 +781,7 @@ BOOL check_name(char *name,int cnum); void sync_file(int fnum); void close_file(int fnum, BOOL normal_close); BOOL check_file_sharing(int cnum,char *fname); -int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname, +int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, int mode,int oplock_request, int *Access,int *action); @@ -791,7 +794,7 @@ int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); -BOOL request_oplock_break(min_share_mode_entry *share_entry, +BOOL request_oplock_break(share_mode_entry *share_entry, uint32 dev, uint32 inode); BOOL snum_used(int snum); BOOL reload_services(BOOL test); |