diff options
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking_shm.c | 131 | ||||
-rw-r--r-- | source3/locking/locking_slow.c | 18 |
2 files changed, 118 insertions, 31 deletions
diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c index 909bdb78e4..b18b5efb2c 100644 --- a/source3/locking/locking_shm.c +++ b/source3/locking/locking_shm.c @@ -139,15 +139,26 @@ static int shm_get_share_modes(connection_struct *conn, if(!found) { - DEBUG(5,("get_share_modes no entry for file dev = %d ino = %d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(5,("get_share_modes no entry for file dev = %x ino = %.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(5,("get_share_modes no entry for file dev = %x ino = %lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return (0); } if(file_scanner_p->locking_version != LOCKING_VERSION) { - DEBUG(0,("ERROR: get_share_modes Deleting old share mode v1 %d dev=%d ino=%d\n", - file_scanner_p->locking_version, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: get_share_modes Deleting old share mode v1 %d dev=%x ino=%.0f\n", + file_scanner_p->locking_version, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: get_share_modes Deleting old share mode v1 %d dev=%x ino=%lx\n", + file_scanner_p->locking_version, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -203,8 +214,13 @@ static int shm_get_share_modes(connection_struct *conn, /* PARANOIA TEST */ if(file_scanner_p->num_share_mode_entries < 0) { - DEBUG(0,("PANIC ERROR: get_share_mode: entries=%d dev=%d ino=%d\n", - file_scanner_p->num_share_mode_entries,dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("PANIC ERROR: get_share_mode: entries=%d dev=%x ino=%.0f\n", + file_scanner_p->num_share_mode_entries, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("PANIC ERROR: get_share_mode: entries=%d dev=%x ino=%lx\n", + file_scanner_p->num_share_mode_entries, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return 0; } @@ -235,8 +251,13 @@ static int shm_get_share_modes(connection_struct *conn, /* If no valid share mode entries were found then this record shouldn't exist ! */ if(num_entries_copied == 0) { - DEBUG(0,("get_share_modes: file with dev %d inode %d empty\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("get_share_modes: file with dev %x inode %.0f empty\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("get_share_modes: file with dev %x inode %lx empty\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ if(*old_shares) free((char *)*old_shares); *old_shares = 0; @@ -248,8 +269,13 @@ static int shm_get_share_modes(connection_struct *conn, shmops->shm_free(shmops->addr2offset(file_scanner_p)); } - DEBUG(5,("get_share_modes: file with dev %d inode %d -> %d entries\n", - dev, inode, num_entries_copied)); +#ifdef LARGE_SMB_INO_T + DEBUG(5,("get_share_modes: file with dev %x inode %.0f -> %d entries\n", + (unsigned int)dev, (double)inode, num_entries_copied)); +#else /* LARGE_SMB_INO_T */ + DEBUG(5,("get_share_modes: file with dev %x inode %lx -> %d entries\n", + (unsigned int)dev, (unsigned long)inode, num_entries_copied)); +#endif /* LARGE_SMB_INO_T */ return(num_entries_copied); } @@ -304,15 +330,26 @@ static void shm_del_share_mode(int token, files_struct *fsp) if(!found) { - DEBUG(0,("ERROR: del_share_mode no entry for dev %d inode %d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: del_share_mode no entry for dev %x inode %.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: del_share_mode no entry for dev %x inode %lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return; } if(file_scanner_p->locking_version != LOCKING_VERSION) { - DEBUG(0,("ERROR: del_share_modes Deleting old share mode v1 %d dev=%d ino=%d\n", - file_scanner_p->locking_version, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: del_share_modes Deleting old share mode v1 %d dev=%x ino=%.0f\n", + file_scanner_p->locking_version, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: del_share_modes Deleting old share mode v1 %d dev=%x ino=%lx\n", + file_scanner_p->locking_version, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -347,8 +384,14 @@ static void shm_del_share_mode(int token, files_struct *fsp) /* Decrement the number of entries in the record. */ file_scanner_p->num_share_mode_entries -= 1; - DEBUG(2,("del_share_modes Deleting share mode entry dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(2,("del_share_modes Deleting share mode entry dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(2,("del_share_modes Deleting share mode entry dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(entry_prev_p == entry_scanner_p) /* We are at start of list */ file_scanner_p->share_mode_entries = entry_scanner_p->next_share_mode_entry; @@ -367,8 +410,14 @@ static void shm_del_share_mode(int token, files_struct *fsp) /* If we deleted the last share mode entry then remove the share mode record. */ if(file_scanner_p->num_share_mode_entries == 0) { - DEBUG(2,("del_share_modes num entries = 0, deleting share_mode dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(2,("del_share_modes num entries = 0, deleting share_mode dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(2,("del_share_modes num entries = 0, deleting share_mode dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -378,8 +427,13 @@ static void shm_del_share_mode(int token, files_struct *fsp) } else { - DEBUG(0,("ERROR: del_share_modes No share mode dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: del_share_modes No share mode dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: del_share_modes No share mode dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ } } @@ -447,8 +501,13 @@ static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 file_scanner_p = new_mode_p; - DEBUG(3,("set_share_mode: Created share record for %s (dev %d inode %d)\n", - fsp->fsp_name, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(3,("set_share_mode: Created share record for %s (dev %x inode %.0f)\n", + fsp->fsp_name, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(3,("set_share_mode: Created share record for %s (dev %x inode %lx)\n", + fsp->fsp_name, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ } /* Now create the share mode entry */ @@ -542,15 +601,26 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) if(!found) { - DEBUG(0,("ERROR:remove_share_oplock: no entry found for dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR:remove_share_oplock: no entry found for dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR:remove_share_oplock: no entry found for dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return False; } if(file_scanner_p->locking_version != LOCKING_VERSION) { - DEBUG(0,("ERROR: remove_share_oplock: Deleting old share mode v1=%d dev=%d ino=%d\n", - file_scanner_p->locking_version, dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: remove_share_oplock: Deleting old share mode v1=%d dev=%x ino=%.0f\n", + file_scanner_p->locking_version, (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: remove_share_oplock: Deleting old share mode v1=%d dev=%x ino=%lx\n", + file_scanner_p->locking_version, (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ + if(file_prev_p == file_scanner_p) mode_array[hash_entry] = file_scanner_p->next_offset; else @@ -586,8 +656,13 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) if(!found) { - DEBUG(0,("ERROR: remove_share_oplock: No oplock granted. dev=%d ino=%d\n", - dev, inode)); +#ifdef LARGE_SMB_INO_T + DEBUG(0,("ERROR: remove_share_oplock: No oplock granted. dev=%x ino=%.0f\n", + (unsigned int)dev, (double)inode)); +#else /* LARGE_SMB_INO_T */ + DEBUG(0,("ERROR: remove_share_oplock: No oplock granted. dev=%x ino=%lx\n", + (unsigned int)dev, (unsigned long)inode)); +#endif /* LARGE_SMB_INO_T */ return False; } diff --git a/source3/locking/locking_slow.c b/source3/locking/locking_slow.c index c9b8d2a687..fd95fd45ec 100644 --- a/source3/locking/locking_slow.c +++ b/source3/locking/locking_slow.c @@ -90,7 +90,11 @@ static BOOL share_name(connection_struct *conn, len = strlen(name); name += len; - slprintf(name, sizeof(pstring) - len - 1, "/share.%u.%u",dev,inode); +#ifdef LARGE_SMB_INO_T + slprintf(name, sizeof(pstring) - len - 1, "/share.%u.%.0f",(unsigned int)dev,(double)inode); +#else /* LARGE_SMB_INO_T */ + slprintf(name, sizeof(pstring) - len - 1, "/share.%u.%lu",(unsigned int)dev,(unsigned long)inode); +#endif /* LARGE_SMB_INO_T */ return(True); } @@ -966,8 +970,16 @@ static int slow_share_forall(void (*fn)(share_mode_entry *, char *)) BOOL new_file; pstring fname; - if (sscanf(s,"share.%u.%u",&dev,&inode)!=2) continue; - +#ifdef LARGE_SMB_INO_T + double inode_ascii; + if (sscanf(s,"share.%u.%lf",&dev,&inode_ascii)!=2) continue; + inode = (SMB_INO_T)inode_ascii; +#else /* LARGE_SMB_INO_T */ + unsigned long inode_long; + if (sscanf(s,"share.%u.%lu",&dev,&inode_long)!=2) continue; + inode = (SMB_INO_T)inode_long; +#endif /* LARGE_SMB_INO_T */ + pstrcpy(lname,lp_lockdir()); trim_string(lname,NULL,"/"); pstrcat(lname,"/"); |