diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-06 18:13:52 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-06 18:13:52 +0000 |
commit | ba00796e6dd13b87b7988a98e532676d9eab702c (patch) | |
tree | 6b53b1fae2ca229ab654bbff46b2e4dd7c4e489f /source3/include | |
parent | 08657e539e4cd4105057a9c12db30dbe4bbfcb1d (diff) | |
download | samba-ba00796e6dd13b87b7988a98e532676d9eab702c.tar.gz samba-ba00796e6dd13b87b7988a98e532676d9eab702c.tar.bz2 samba-ba00796e6dd13b87b7988a98e532676d9eab702c.zip |
Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!).
Jeremy.
(This used to be commit dfe77c7046cbd65ee52aea7439f21503c1eac41d)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/includes.h | 5 | ||||
-rw-r--r-- | source3/include/profile.h | 72 | ||||
-rw-r--r-- | source3/include/proto.h | 6 | ||||
-rw-r--r-- | source3/include/smb.h | 7 | ||||
-rw-r--r-- | source3/include/vfs.h | 4 |
5 files changed, 67 insertions, 27 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index ad2771665a..da365ab953 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -635,12 +635,7 @@ extern int errno; #include "msdfs.h" -#ifdef WITH_PROFILE #include "profile.h" -#else -#define START_PROFILE(x) -#define END_PROFILE(x) -#endif #ifndef MAXCODEPAGELINES #define MAXCODEPAGELINES 256 diff --git a/source3/include/profile.h b/source3/include/profile.h index 9b6ec462df..d18f598021 100644 --- a/source3/include/profile.h +++ b/source3/include/profile.h @@ -22,6 +22,14 @@ */ +/* + * Reasons for cache flush. + */ + +#define NUM_FLUSH_REASONS 8 /* Keep this in sync with the enum below. */ +enum flush_reason_enum { SEEK_FLUSH, READ_FLUSH, WRITE_FLUSH, READRAW_FLUSH, + OPLOCK_RELEASE_FLUSH, CLOSE_FLUSH, SYNC_FLUSH, SIZECHANGE_FLUSH }; + /* this file defines the profile structure in the profile shared memory area */ @@ -308,19 +316,61 @@ struct profile_struct { extern struct profile_struct *profile_p; +extern struct timeval profile_starttime; +extern struct timeval profile_endtime; +extern BOOL do_profile_flag; -#define INC_PROFILE_COUNT(x) if (profile_p) profile_p->x++ -#define DEC_PROFILE_COUNT(x) if (profile_p) profile_p->x-- -#define ADD_PROFILE_COUNT(x,y) if (profile_p) profile_p->x += (y) +/* these are helper macros - do not call them directly in the code + * use the DO_PROFILE_* START_PROFILE and END_PROFILE ones + * below which test for the profile flage first + */ +#define INC_PROFILE_COUNT(x) profile_p->x++ +#define DEC_PROFILE_COUNT(x) profile_p->x-- +#define ADD_PROFILE_COUNT(x,y) profile_p->x += (y) +#define PROFILE_TIME TvalDiff(&profile_starttime,&profile_endtime) +#ifdef WITH_PROFILE +#define DO_PROFILE_INC(x) \ + if (do_profile_flag) { \ + INC_PROFILE_COUNT(x); \ + } +#define DO_PROFILE_DEC(x) \ + if (do_profile_flag) { \ + DEC_PROFILE_COUNT(x); \ + } +#define DO_PROFILE_DEC_INC(x,y) \ + if (do_profile_flag) { \ + DEC_PROFILE_COUNT(x); \ + INC_PROFILE_COUNT(y); \ + } +#define DO_PROFILE_ADD(x,n) \ + if (do_profile_flag) { \ + ADD_PROFILE_COUNT(x,n); \ + } #define START_PROFILE(x) \ - struct timeval starttime; \ - struct timeval endtime; \ - GetTimeOfDay(&starttime); \ - INC_PROFILE_COUNT(x##_count) - -#define END_PROFILE(y) \ - GetTimeOfDay(&endtime); \ - ADD_PROFILE_COUNT((y##_time),TvalDiff(&starttime,&endtime)) + if (do_profile_flag) { \ + GetTimeOfDay(&profile_starttime); \ + INC_PROFILE_COUNT(x##_count); \ + } +#define START_PROFILE_BYTES(x,n) \ + if (do_profile_flag) { \ + GetTimeOfDay(&profile_starttime); \ + INC_PROFILE_COUNT(x##_count); \ + ADD_PROFILE_COUNT(x##_bytes,n); \ + } +#define END_PROFILE(x) \ + if (do_profile_flag) { \ + GetTimeOfDay(&profile_endtime); \ + ADD_PROFILE_COUNT(x##_time,PROFILE_TIME); \ + } +#else +#define DO_PROFILE_INC(x) +#define DO_PROFILE_DEC(x) +#define DO_PROFILE_DEC_INC(x,y) +#define DO_PROFILE_ADD(x,n) +#define START_PROFILE(x) +#define START_PROFILE_BYTES(x,n) +#define END_PROFILE(x) +#endif #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 2457856425..22c3f48f86 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3793,7 +3793,6 @@ int sslutil_negotiate_ssl(int fd, int msg_type); /*The following definitions come from smbd/statcache.c */ -void print_stat_cache_statistics(void); void stat_cache_add( char *full_orig_name, char *orig_translated_path); BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath, char **start, SMB_STRUCT_STAT *pst); @@ -3834,7 +3833,7 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd); /*The following definitions come from smbd/vfs-wrap.c */ int vfswrap_dummy_connect(connection_struct *conn, char *service, char *user); -void vfswrap_dummy_disconnect(void); +void vfswrap_dummy_disconnect(connection_struct *conn); SMB_BIG_UINT vfswrap_disk_free(connection_struct *conn, char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); DIR *vfswrap_opendir(connection_struct *conn, char *fname); @@ -3860,6 +3859,9 @@ char *vfswrap_getwd(connection_struct *conn, char *path); int vfswrap_utime(connection_struct *conn, char *path, struct utimbuf *times); int vfswrap_ftruncate(files_struct *fsp, int fd, SMB_OFF_T offset); BOOL vfswrap_lock(files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); +size_t vfswrap_fget_nt_acl(files_struct *fsp, int fd, SEC_DESC **ppdesc); +size_t vfswrap_get_nt_acl(files_struct *fsp, char *name, SEC_DESC **ppdesc); +BOOL vfswrap_fset_nt_acl(files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd); /*The following definitions come from smbd/vfs.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 24211b0d50..4d4aef088e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -617,13 +617,6 @@ struct current_user NT_USER_TOKEN *nt_user_token; }; -/* - * Reasons for cache flush. - */ - -#define NUM_FLUSH_REASONS 8 /* Keep this in sync with the enum below. */ -enum flush_reason_enum { SEEK_FLUSH, READ_FLUSH, WRITE_FLUSH, READRAW_FLUSH, - OPLOCK_RELEASE_FLUSH, CLOSE_FLUSH, SYNC_FLUSH, SIZECHANGE_FLUSH }; /* Defines for the sent_oplock_break field above. */ #define NO_BREAK_SENT 0 #define EXCLUSIVE_BREAK_SENT 1 diff --git a/source3/include/vfs.h b/source3/include/vfs.h index fb089c86cc..3624311c30 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -78,9 +78,9 @@ struct vfs_ops { BOOL (*lock)(struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); size_t (*fget_nt_acl)(struct files_struct *fsp, int fd, struct security_descriptor_info **ppdesc); - size_t (*get_nt_acl)(struct connection_struct *conn, char *name, struct security_descriptor_info **ppdesc); + size_t (*get_nt_acl)(struct files_struct *fsp, char *name, struct security_descriptor_info **ppdesc); BOOL (*fset_nt_acl)(struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd); - BOOL (*set_nt_acl)(struct connection_struct *conn, char *name, uint32 security_info_sent, struct security_descriptor_info *psd); + BOOL (*set_nt_acl)(struct files_struct *fsp, char *name, uint32 security_info_sent, struct security_descriptor_info *psd); }; struct vfs_options { |