summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-28 02:15:11 +0000
committerGerald Carter <jerry@samba.org>2003-01-28 02:15:11 +0000
commitdb56e6f8f0520547dc9cedcf76120fe404f20a16 (patch)
treeb2e0fd2f084e4c1082cce50ac9c6725d09293d27 /source3
parentf4733888873da451813f542284aa86869f266256 (diff)
downloadsamba-db56e6f8f0520547dc9cedcf76120fe404f20a16.tar.gz
samba-db56e6f8f0520547dc9cedcf76120fe404f20a16.tar.bz2
samba-db56e6f8f0520547dc9cedcf76120fe404f20a16.zip
performance patch from HP-UX folks (cant remember who)
(This used to be commit d6c22e693efee88c17f1f0f6c861e7101b3fec99)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/quotas.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 90fd4bbdac..9d3bfe2d64 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -886,10 +886,21 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
#if !defined(__FreeBSD__) && !defined(AIX) && !defined(__OpenBSD__)
char dev_disk[256];
SMB_STRUCT_STAT S;
+
/* find the block device file */
- if ((sys_stat(path, &S)<0) ||
- (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) return (False);
-#endif
+
+#ifdef HPUX
+ /* Need to set the cache flag to 1 for HPUX. Seems
+ * to have a significant performance boost when
+ * lstat calls on /dev access this function.
+ */
+ if ((sys_stat(path, &S)<0) || (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 1)<0))
+#else
+ if ((sys_stat(path, &S)<0) || (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0))
+ return (False);
+#endif /* ifdef HPUX */
+
+#endif /* !defined(__FreeBSD__) && !defined(AIX) && !defined(__OpenBSD__) */
euser_id = geteuid();