diff options
author | Tim Prouty <tprouty@samba.org> | 2009-02-16 16:06:45 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-02-19 21:09:30 -0800 |
commit | 04a7213eb6a2b776c17a5b56ba3b66e3c3444507 (patch) | |
tree | d401894a804be1700bd5bd52ccb46607da20b06d | |
parent | 2b53b791938bf6b6855b854561dcff70dbc328d3 (diff) | |
download | samba-04a7213eb6a2b776c17a5b56ba3b66e3c3444507.tar.gz samba-04a7213eb6a2b776c17a5b56ba3b66e3c3444507.tar.bz2 samba-04a7213eb6a2b776c17a5b56ba3b66e3c3444507.zip |
s3: Change the vfs_GetWd cache to use the file_id struct
-rw-r--r-- | source3/smbd/vfs.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 9580247368..426772889c 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -766,18 +766,13 @@ int vfs_ChDir(connection_struct *conn, const char *path) format. Note this can be called with conn == NULL. ********************************************************************/ -struct getwd_cache_key { - SMB_DEV_T dev; - SMB_INO_T ino; -}; - char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn) { char s[PATH_MAX+1]; SMB_STRUCT_STAT st, st2; char *result; DATA_BLOB cache_value; - struct getwd_cache_key key; + struct file_id key; *s = 0; @@ -797,9 +792,7 @@ char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn) goto nocache; } - ZERO_STRUCT(key); /* unlikely, but possible padding */ - key.dev = st.st_dev; - key.ino = st.st_ino; + key = vfs_file_id_from_sbuf(conn, &st); if (!memcache_lookup(smbd_memcache(), GETWD_CACHE, data_blob_const(&key, sizeof(key)), @@ -838,9 +831,7 @@ char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn) } if (lp_getwd_cache() && VALID_STAT(st)) { - ZERO_STRUCT(key); /* unlikely, but possible padding */ - key.dev = st.st_dev; - key.ino = st.st_ino; + key = vfs_file_id_from_sbuf(conn, &st); memcache_add(smbd_memcache(), GETWD_CACHE, data_blob_const(&key, sizeof(key)), |