diff options
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 56 | ||||
-rw-r--r-- | source3/locking/locking_shm.c | 38 | ||||
-rw-r--r-- | source3/locking/locking_slow.c | 68 |
3 files changed, 75 insertions, 87 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index bb852b07d6..50c4af2265 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -33,7 +33,6 @@ #include "includes.h" extern int DEBUGLEVEL; -extern files_struct Files[]; extern int Client; static struct share_ops *share_ops; @@ -62,7 +61,7 @@ static ubi_slList blocking_lock_queue = { NULL, (ubi_slNodePtr)&blocking_lock_qu BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num) { blocking_lock_record *blr; - int fnum = GETFNUM(inbuf,smb_vwv2); + files_struct *fsp = GETFSP(inbuf,smb_vwv2); /* * Now queue an entry on the blocking lock queue. We setup @@ -88,7 +87,7 @@ BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int ubi_slAddTail(&blocking_lock_queue, blr); DEBUG(3,("push_blocking_lock_request: lock request blocked with expiry time %d \ -for fnum = %d, name = %s\n", blr->expire_time, fnum, Files[fnum].name )); +for fnum = %d, name = %s\n", blr->expire_time, fsp->fnum, fsp->name )); return True; } @@ -96,16 +95,15 @@ for fnum = %d, name = %s\n", blr->expire_time, fnum, Files[fnum].name )); /**************************************************************************** Return a blocking lock success SMB. *****************************************************************************/ - static void blocking_lock_reply_success(blocking_lock_record *blr) { extern int chain_size; - extern int chain_fnum; + extern files_struct *chain_fsp; extern char *OutBuffer; char *outbuf = OutBuffer; int bufsize = BUFFER_SIZE; char *inbuf = blr->inbuf; - int fnum = GETFNUM(inbuf,smb_vwv2); + files_struct *fsp = GETFSP(inbuf,smb_vwv2); int outsize = 0; construct_reply_common(inbuf, outbuf); @@ -119,7 +117,7 @@ static void blocking_lock_reply_success(blocking_lock_record *blr) * that here and must set up the chain info manually. */ - chain_fnum = fnum; + chain_fsp = fsp; chain_size = 0; outsize = chain_reply(inbuf,outbuf,blr->length,bufsize); @@ -142,7 +140,7 @@ static void blocking_lock_reply_error(blocking_lock_record *blr, int eclass, int char *outbuf = OutBuffer; int bufsize = BUFFER_SIZE; char *inbuf = blr->inbuf; - int fnum = GETFNUM(inbuf,smb_vwv2); + files_struct *fsp = GETFSP(inbuf,smb_vwv2); uint16 num_ulocks = SVAL(inbuf,smb_vwv6); uint16 num_locks = SVAL(inbuf,smb_vwv7); uint32 count, offset; @@ -160,7 +158,7 @@ static void blocking_lock_reply_error(blocking_lock_record *blr, int eclass, int for(i = blr->lock_num; i >= 0; i--) { count = IVAL(data,SMB_LKLEN_OFFSET(i)); offset = IVAL(data,SMB_LKOFF_OFFSET(i)); - do_unlock(fnum,conn,count,offset,&dummy1,&dummy2); + do_unlock(fsp,conn,count,offset,&dummy1,&dummy2); } construct_reply_common(inbuf, outbuf); @@ -177,7 +175,7 @@ static BOOL blocking_lock_record_process(blocking_lock_record *blr) { char *inbuf = blr->inbuf; unsigned char locktype = CVAL(inbuf,smb_vwv3); - int fnum = GETFNUM(inbuf,smb_vwv2); + files_struct *fsp = GETFSP(inbuf,smb_vwv2); uint16 num_ulocks = SVAL(inbuf,smb_vwv6); uint16 num_locks = SVAL(inbuf,smb_vwv7); uint32 count, offset; @@ -196,7 +194,7 @@ static BOOL blocking_lock_record_process(blocking_lock_record *blr) for(; blr->lock_num < num_locks; blr->lock_num++) { count = IVAL(data,SMB_LKLEN_OFFSET(blr->lock_num)); offset = IVAL(data,SMB_LKOFF_OFFSET(blr->lock_num)); - if(!do_lock(fnum,conn,count,offset, ((locktype & 1) ? F_RDLCK : F_WRLCK), + if(!do_lock(fsp,conn,count,offset, ((locktype & 1) ? F_RDLCK : F_WRLCK), &eclass, &ecode)) break; } @@ -208,7 +206,7 @@ static BOOL blocking_lock_record_process(blocking_lock_record *blr) */ DEBUG(3,("blocking_lock_record_process fnum=%d type=%d num_locks=%d\n", - fnum, (unsigned int)locktype, num_locks) ); + fsp->fnum, (unsigned int)locktype, num_locks) ); blocking_lock_reply_success(blr); return True; @@ -230,7 +228,7 @@ static BOOL blocking_lock_record_process(blocking_lock_record *blr) */ DEBUG(10,("blocking_lock_record_process: only got %d locks of %d needed for fnum = %d. \ -Waiting..\n", blr->lock_num, num_locks, fnum )); +Waiting..\n", blr->lock_num, num_locks, fsp->fnum)); return False; } @@ -252,13 +250,12 @@ void process_blocking_lock_queue(time_t t) */ while(blr != NULL) { - int fnum = GETFNUM(blr->inbuf,smb_vwv2); - files_struct *fsp = &Files[fnum]; + files_struct *fsp = GETFSP(blr->inbuf,smb_vwv2); uint16 vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID : SVAL(blr->inbuf,smb_uid); DEBUG(5,("process_blocking_lock_queue: examining pending lock fnum = %d for file %s\n", - fnum, fsp->name )); + fsp->fnum, fsp->name )); if((blr->expire_time != -1) && (blr->expire_time > t)) { /* @@ -266,7 +263,7 @@ void process_blocking_lock_queue(time_t t) * obtained locks and return lock error. */ DEBUG(5,("process_blocking_lock_queue: pending lock fnum = %d for file %s timed out.\n", - fnum, fsp->name )); + fsp->fnum, fsp->name )); blocking_lock_reply_error(blr,ERRSRV,ERRaccess); free_blocking_lock_record((blocking_lock_record *)ubi_slRemNext( &blocking_lock_queue, prev)); @@ -356,11 +353,10 @@ static int map_lock_type( files_struct *fsp, int lock_type) /**************************************************************************** Utility function called to see if a file region is locked. ****************************************************************************/ -BOOL is_locked(int fnum,connection_struct *conn, +BOOL is_locked(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset, int lock_type) { int snum = SNUM(conn); - files_struct *fsp = &Files[fnum]; if (count == 0) return(False); @@ -381,12 +377,11 @@ BOOL is_locked(int fnum,connection_struct *conn, /**************************************************************************** Utility function called by locking requests. ****************************************************************************/ -BOOL do_lock(int fnum,connection_struct *conn, +BOOL do_lock(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset,int lock_type, int *eclass,uint32 *ecode) { BOOL ok = False; - files_struct *fsp = &Files[fnum]; if (!lp_locking(SNUM(conn))) return(True); @@ -397,7 +392,7 @@ BOOL do_lock(int fnum,connection_struct *conn, return False; } - if (OPEN_FNUM(fnum) && fsp->can_lock && (fsp->conn == conn)) + if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) ok = fcntl_lock(fsp->fd_ptr->fd,F_SETLK,offset,count, map_lock_type(fsp,lock_type)); @@ -413,16 +408,15 @@ BOOL do_lock(int fnum,connection_struct *conn, /**************************************************************************** Utility function called by unlocking requests. ****************************************************************************/ -BOOL do_unlock(int fnum,connection_struct *conn, +BOOL do_unlock(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset,int *eclass,uint32 *ecode) { BOOL ok = False; - files_struct *fsp = &Files[fnum]; if (!lp_locking(SNUM(conn))) return(True); - if (OPEN_FNUM(fnum) && fsp->can_lock && (fsp->conn == conn)) + if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) ok = fcntl_lock(fsp->fd_ptr->fd,F_SETLK,offset,count,F_UNLCK); if (!ok) { @@ -501,26 +495,26 @@ int get_share_modes(connection_struct *conn, Del the share mode of a file. ********************************************************************/ -void del_share_mode(int token, int fnum) +void del_share_mode(int token, files_struct *fsp) { - share_ops->del_entry(token, fnum); + share_ops->del_entry(token, fsp); } /******************************************************************* Set the share mode of a file. Return False on fail, True on success. ********************************************************************/ -BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type) +BOOL set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type) { - return share_ops->set_entry(token, fnum, port, op_type); + return share_ops->set_entry(token, fsp, port, op_type); } /******************************************************************* Remove an oplock port and mode entry from a share mode. ********************************************************************/ -BOOL remove_share_oplock(int fnum, int token) +BOOL remove_share_oplock(files_struct *fsp, int token) { - return share_ops->remove_oplock(fnum, token); + return share_ops->remove_oplock(fsp, token); } /******************************************************************* diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c index 84310d3a33..cded5e628d 100644 --- a/source3/locking/locking_shm.c +++ b/source3/locking/locking_shm.c @@ -37,7 +37,6 @@ #ifdef FAST_SHARE_MODES extern int DEBUGLEVEL; -extern files_struct Files[]; static struct shmem_ops *shmops; @@ -258,7 +257,7 @@ static int shm_get_share_modes(connection_struct *conn, /******************************************************************* del the share mode of a file. ********************************************************************/ -static void shm_del_share_mode(int token, int fnum) +static void shm_del_share_mode(int token, files_struct *fsp) { uint32 dev, inode; int *mode_array; @@ -270,8 +269,8 @@ static void shm_del_share_mode(int token, int fnum) BOOL found = False; int pid = getpid(); - dev = Files[fnum].fd_ptr->dev; - inode = Files[fnum].fd_ptr->inode; + dev = fsp->fd_ptr->dev; + inode = fsp->fd_ptr->inode; hash_entry = HASH_ENTRY(dev, inode); @@ -329,7 +328,7 @@ static void shm_del_share_mode(int token, int fnum) { if( (pid == entry_scanner_p->e.pid) && (memcmp(&entry_scanner_p->e.time, - &Files[fnum].open_time,sizeof(struct timeval)) == 0) ) + &fsp->open_time,sizeof(struct timeval)) == 0) ) { found = True; break; @@ -386,9 +385,8 @@ static void shm_del_share_mode(int token, int fnum) /******************************************************************* set the share mode of a file. Return False on fail, True on success. ********************************************************************/ -static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) +static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type) { - files_struct *fs_p = &Files[fnum]; int32 dev, inode; int *mode_array; unsigned int hash_entry; @@ -398,8 +396,8 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) int new_entry_offset; BOOL found = False; - dev = fs_p->fd_ptr->dev; - inode = fs_p->fd_ptr->inode; + dev = fsp->fd_ptr->dev; + inode = fsp->fd_ptr->inode; hash_entry = HASH_ENTRY(dev, inode); @@ -428,7 +426,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) /* We must create a share_mode_record */ share_mode_record *new_mode_p = NULL; int new_offset = shmops->shm_alloc(sizeof(share_mode_record) + - strlen(fs_p->fsp_name) + 1); + strlen(fsp->fsp_name) + 1); if(new_offset == 0) { DEBUG(0,("ERROR:set_share_mode shmops->shm_alloc fail!\n")); return False; @@ -439,7 +437,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) new_mode_p->st_ino = inode; new_mode_p->num_share_mode_entries = 0; new_mode_p->share_mode_entries = 0; - pstrcpy(new_mode_p->file_name, fs_p->fsp_name); + pstrcpy(new_mode_p->file_name, fsp->fsp_name); /* Chain onto the start of the hash chain (in the hope we will be used first). */ new_mode_p->next_offset = mode_array[hash_entry]; @@ -448,7 +446,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) file_scanner_p = new_mode_p; DEBUG(3,("set_share_mode: Created share record for %s (dev %d inode %d)\n", - fs_p->fsp_name, dev, inode)); + fsp->fsp_name, dev, inode)); } /* Now create the share mode entry */ @@ -466,10 +464,10 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) new_entry_p = shmops->offset2addr(new_entry_offset); new_entry_p->e.pid = getpid(); - new_entry_p->e.share_mode = fs_p->share_mode; + new_entry_p->e.share_mode = fsp->share_mode; new_entry_p->e.op_port = port; new_entry_p->e.op_type = op_type; - memcpy( (char *)&new_entry_p->e.time, (char *)&fs_p->open_time, sizeof(struct timeval)); + memcpy( (char *)&new_entry_p->e.time, (char *)&fsp->open_time, sizeof(struct timeval)); /* Chain onto the share_mode_record */ new_entry_p->next_share_mode_entry = file_scanner_p->share_mode_entries; @@ -487,7 +485,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) file_scanner_p->num_share_mode_entries += 1; DEBUG(3,("set_share_mode: Created share entry for %s with mode 0x%X pid=%d\n", - fs_p->fsp_name, fs_p->share_mode, new_entry_p->e.pid)); + fsp->fsp_name, fsp->share_mode, new_entry_p->e.pid)); return(True); } @@ -495,7 +493,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) /******************************************************************* Remove an oplock port and mode entry from a share mode. ********************************************************************/ -static BOOL shm_remove_share_oplock(int fnum, int token) +static BOOL shm_remove_share_oplock(files_struct *fsp, int token) { uint32 dev, inode; int *mode_array; @@ -507,8 +505,8 @@ static BOOL shm_remove_share_oplock(int fnum, int token) BOOL found = False; int pid = getpid(); - dev = Files[fnum].fd_ptr->dev; - inode = Files[fnum].fd_ptr->inode; + dev = fsp->fd_ptr->dev; + inode = fsp->fd_ptr->inode; hash_entry = HASH_ENTRY(dev, inode); @@ -565,9 +563,9 @@ static BOOL shm_remove_share_oplock(int fnum, int token) while(entry_scanner_p) { if( (pid == entry_scanner_p->e.pid) && - (entry_scanner_p->e.share_mode == Files[fnum].share_mode) && + (entry_scanner_p->e.share_mode == fsp->share_mode) && (memcmp(&entry_scanner_p->e.time, - &Files[fnum].open_time,sizeof(struct timeval)) == 0) ) + &fsp->open_time,sizeof(struct timeval)) == 0) ) { /* Delete the oplock info. */ entry_scanner_p->e.op_port = 0; diff --git a/source3/locking/locking_slow.c b/source3/locking/locking_slow.c index 9135ae29d2..8b56e7599b 100644 --- a/source3/locking/locking_slow.c +++ b/source3/locking/locking_slow.c @@ -37,7 +37,6 @@ #ifndef FAST_SHARE_MODES extern int DEBUGLEVEL; -extern files_struct Files[]; /* * Locking file header lengths & offsets. @@ -534,7 +533,7 @@ mode file %s to size %d (%s)\n", fname, newsize, strerror(errno))); /******************************************************************* del a share mode from a share mode file. ********************************************************************/ -static void slow_del_share_mode(int token, int fnum) +static void slow_del_share_mode(int token, files_struct *fsp) { pstring fname; int fd = (int)token; @@ -543,15 +542,14 @@ static void slow_del_share_mode(int token, int fnum) int num_entries; int newsize; int i; - files_struct *fs_p = &Files[fnum]; int pid; BOOL deleted = False; BOOL new_file; - share_name(fs_p->conn, fs_p->fd_ptr->dev, - fs_p->fd_ptr->inode, fname); + share_name(fsp->conn, fsp->fd_ptr->dev, + fsp->fd_ptr->inode, fname); - if(read_share_file( fs_p->conn, fd, fname, &buf, &new_file) != 0) + if(read_share_file( fsp->conn, fd, fname, &buf, &new_file) != 0) { DEBUG(0,("ERROR: del_share_mode: Failed to read share file %s\n", fname)); @@ -562,7 +560,7 @@ static void slow_del_share_mode(int token, int fnum) { DEBUG(0,("ERROR:del_share_mode: share file %s is new (size zero), deleting it.\n", fname)); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); return; } @@ -586,7 +584,7 @@ for share file %d\n", num_entries, fname)); fname)); if(buf) free(buf); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); return; } @@ -602,9 +600,9 @@ for share file %d\n", num_entries, fname)); { char *p = base + (i*SMF_ENTRY_LENGTH); - if((IVAL(p,SME_SEC_OFFSET) != fs_p->open_time.tv_sec) || - (IVAL(p,SME_USEC_OFFSET) != fs_p->open_time.tv_usec) || - (IVAL(p,SME_SHAREMODE_OFFSET) != fs_p->share_mode) || + if((IVAL(p,SME_SEC_OFFSET) != fsp->open_time.tv_sec) || + (IVAL(p,SME_USEC_OFFSET) != fsp->open_time.tv_usec) || + (IVAL(p,SME_SHAREMODE_OFFSET) != fsp->share_mode) || (IVAL(p,SME_PID_OFFSET) != pid)) continue; @@ -637,7 +635,7 @@ for share file %d\n", num_entries, fname)); fname)); if(buf) free(buf); - delete_share_file(fs_p->conn,fname); + delete_share_file(fsp->conn,fname); return; } @@ -675,9 +673,8 @@ mode file %s to size %d (%s)\n", fname, newsize, strerror(errno))); /******************************************************************* set the share mode of a file ********************************************************************/ -static BOOL slow_set_share_mode(int token,int fnum, uint16 port, uint16 op_type) +static BOOL slow_set_share_mode(int token,files_struct *fsp, uint16 port, uint16 op_type) { - files_struct *fs_p = &Files[fnum]; pstring fname; int fd = (int)token; int pid = (int)getpid(); @@ -687,8 +684,8 @@ static BOOL slow_set_share_mode(int token,int fnum, uint16 port, uint16 op_type) int header_size; char *p; - share_name(fs_p->conn, fs_p->fd_ptr->dev, - fs_p->fd_ptr->inode, fname); + share_name(fsp->conn, fsp->fd_ptr->dev, + fsp->fd_ptr->inode, fname); if(fstat(fd, &sb) != 0) { @@ -735,7 +732,7 @@ locking version (was %d, should be %d).\n",fname, IVAL(buf,SMF_VERSION_OFFSET), LOCKING_VERSION)); if(buf) free(buf); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); return False; } @@ -748,7 +745,7 @@ locking version (was %d, should be %d).\n",fname, IVAL(buf,SMF_VERSION_OFFSET), deleting it.\n", fname)); if(buf) free(buf); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); return False; } @@ -757,23 +754,23 @@ deleting it.\n", fname)); { /* New file - just use a single_entry. */ if((buf = (char *)malloc(SMF_HEADER_LENGTH + - strlen(fs_p->name) + 1 + SMF_ENTRY_LENGTH)) == NULL) + strlen(fsp->name) + 1 + SMF_ENTRY_LENGTH)) == NULL) { DEBUG(0,("ERROR: set_share_mode: malloc failed for single entry.\n")); return False; } SIVAL(buf,SMF_VERSION_OFFSET,LOCKING_VERSION); SIVAL(buf,SMF_NUM_ENTRIES_OFFSET,0); - SSVAL(buf,SMF_FILENAME_LEN_OFFSET,strlen(fs_p->name) + 1); - pstrcpy(buf + SMF_HEADER_LENGTH, fs_p->name); + SSVAL(buf,SMF_FILENAME_LEN_OFFSET,strlen(fsp->name) + 1); + pstrcpy(buf + SMF_HEADER_LENGTH, fsp->name); } num_entries = IVAL(buf,SMF_NUM_ENTRIES_OFFSET); header_size = SMF_HEADER_LENGTH + SVAL(buf,SMF_FILENAME_LEN_OFFSET); p = buf + header_size + (num_entries * SMF_ENTRY_LENGTH); - SIVAL(p,SME_SEC_OFFSET,fs_p->open_time.tv_sec); - SIVAL(p,SME_USEC_OFFSET,fs_p->open_time.tv_usec); - SIVAL(p,SME_SHAREMODE_OFFSET,fs_p->share_mode); + SIVAL(p,SME_SEC_OFFSET,fsp->open_time.tv_sec); + SIVAL(p,SME_USEC_OFFSET,fsp->open_time.tv_usec); + SIVAL(p,SME_SHAREMODE_OFFSET,fsp->share_mode); SIVAL(p,SME_PID_OFFSET,pid); SSVAL(p,SME_PORT_OFFSET,port); SSVAL(p,SME_OPLOCK_TYPE_OFFSET,op_type); @@ -796,7 +793,7 @@ deleting it.\n", fname)); { DEBUG(2,("ERROR: set_share_mode: Failed to write share file %s - \ deleting it (%s).\n",fname, strerror(errno))); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); if(buf) free(buf); return False; @@ -818,7 +815,7 @@ mode file %s to size %d (%s)\n", fname, header_size + (SMF_ENTRY_LENGTH*num_entr free(buf); DEBUG(3,("set_share_mode: Created share file %s with \ -mode 0x%X pid=%d\n",fname,fs_p->share_mode,pid)); +mode 0x%X pid=%d\n",fname,fsp->share_mode,pid)); return True; } @@ -826,7 +823,7 @@ mode 0x%X pid=%d\n",fname,fs_p->share_mode,pid)); /******************************************************************* Remove an oplock port and mode entry from a share mode. ********************************************************************/ -static BOOL slow_remove_share_oplock(int fnum, int token) +static BOOL slow_remove_share_oplock(files_struct *fsp, int token) { pstring fname; int fd = (int)token; @@ -835,15 +832,14 @@ static BOOL slow_remove_share_oplock(int fnum, int token) int num_entries; int fsize; int i; - files_struct *fs_p = &Files[fnum]; int pid; BOOL found = False; BOOL new_file; - share_name(fs_p->conn, fs_p->fd_ptr->dev, - fs_p->fd_ptr->inode, fname); + share_name(fsp->conn, fsp->fd_ptr->dev, + fsp->fd_ptr->inode, fname); - if(read_share_file( fs_p->conn, fd, fname, &buf, &new_file) != 0) + if(read_share_file( fsp->conn, fd, fname, &buf, &new_file) != 0) { DEBUG(0,("ERROR: remove_share_oplock: Failed to read share file %s\n", fname)); @@ -854,7 +850,7 @@ static BOOL slow_remove_share_oplock(int fnum, int token) { DEBUG(0,("ERROR: remove_share_oplock: share file %s is new (size zero), \ deleting it.\n", fname)); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); return False; } @@ -878,7 +874,7 @@ for share file %d\n", num_entries, fname)); fname)); if(buf) free(buf); - delete_share_file(fs_p->conn, fname); + delete_share_file(fsp->conn, fname); return False; } @@ -894,9 +890,9 @@ for share file %d\n", num_entries, fname)); { char *p = base + (i*SMF_ENTRY_LENGTH); - if((IVAL(p,SME_SEC_OFFSET) != fs_p->open_time.tv_sec) || - (IVAL(p,SME_USEC_OFFSET) != fs_p->open_time.tv_usec) || - (IVAL(p,SME_SHAREMODE_OFFSET) != fs_p->share_mode) || + if((IVAL(p,SME_SEC_OFFSET) != fsp->open_time.tv_sec) || + (IVAL(p,SME_USEC_OFFSET) != fsp->open_time.tv_usec) || + (IVAL(p,SME_SHAREMODE_OFFSET) != fsp->share_mode) || (IVAL(p,SME_PID_OFFSET) != pid)) continue; |