1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

472 Commits

Author SHA1 Message Date
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Günther Deschner
7ac1ae8d1c s3-printing: fix debug statement in virtual registry layer
(key_driver_fetch_keys).

Guenther
2009-05-06 10:20:52 +02:00
Michael Adam
e935d8616b s3:registry: replace typedef REGISTRY_OPS by struct registry_ops
Michael
2009-04-27 11:21:04 +02:00
Michael Adam
c9b1734419 s3:registry replace typedef REGISTRY_HOOK by struct registry_hook.
Michael
2009-04-27 11:21:04 +02:00
Michael Adam
cec8428747 s3:registry: replace typedef REGISTRY_KEY by struct registry_key_handle
Michael
2009-04-27 11:21:04 +02:00
Michael Adam
8185d31fb0 s3:registry: replace typedef REGISTRY_VALUE by struct regval_blob
Michael
2009-04-27 11:21:03 +02:00
Michael Adam
221151a2a2 s3:registry: replace typedef REGVAL_CTR by struct regval_ctr.
This paves the way for hiding the typedef and the implementation
from the surface.

Michael
2009-04-27 11:21:02 +02:00
Jelmer Vernooij
f4195183a4 s3: Use common security_descriptor_equal(). 2009-04-21 18:17:40 +02:00
Günther Deschner
38264bb3b8 s3-secdesc: move all winreg access bits to IDL.
Guenther
2009-04-21 12:42:51 +02:00
Michael Adam
8c023fea86 s3:registry: Prevent creation of keys containing the '/' character.
This creates a broken registry that can only be fixed with
tdbtool, since the '/' sign is used as a key separator after
normalization at a lower level.

This makes e.g. "net conf setparm abc/def comment xyz" fail with
WERR_INVALID_PARAM, which is much more desirable than a broken
registry.tdb.

Michael
2009-04-17 11:46:14 +02:00
Günther Deschner
8000479d18 s3-registry: remove last sec_io_desc() caller.
This is a temporary solution while waiting for the regf merge from s4.

Guenther
2009-03-25 22:50:40 +01:00
Günther Deschner
6549408a4d s3-spoolss: rename construct_dev_mode_new to construct_dev_mode.
Guenther
2009-03-17 18:39:43 +01:00
Günther Deschner
827ba0a64b s3-spoolss/registry: use libndr to push a spoolss_DeviceMode in fill_in_printer_values().
Guenther
2009-03-17 18:39:36 +01:00
Günther Deschner
96998f0358 s3-spoolss/registry: use marshall_sec_desc in fill_in_printer_values().
Guenther
2009-03-17 18:39:29 +01:00
Günther Deschner
d759f9961a s3-spoolss: move SYSTEMTIME parsing to a more generic place, as suggested.
Guenther
2009-03-17 18:39:23 +01:00
Volker Lendecke
62db0ea0cf Use talloc_tos() in regkey_access_check() 2009-02-27 11:20:17 +01:00
Michael Adam
2f4b821320 s3:registry: tighten the subkey loop in reg_deletekey_recursive()
and loop from the end to the beginning so that we don't need
to rehash the subkeys...

This gets "net conf drop" with 2000 shares down to 14 seconds
on my box.

Michael
2009-02-26 13:22:56 +01:00
Michael Adam
270ab5544b s3:registry: use delete_reg_subkey() in reg_deletekey()
This further speeds up net conf drop.

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
ae8c584218 s3:registry: implement delete_subkey in the smbconf backend
delegating the call to the db backend

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
b5fbe06d74 s3:registry: implement delete_subkey in the db backend
Michael
2009-02-26 13:22:55 +01:00
Michael Adam
97508eefb7 s3:registry: add a delete_subkey method to the backend ops.
This is to provide a more atomic means of deleting a subkey of a key.

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
61bdfd09ed s3:registry: refactor deletion of various subkey lists out of regdb_store_keys()
Micheal
2009-02-26 13:22:55 +01:00
Michael Adam
13ceeeedbc s3:registry: streamline and cleanup regdb_set_secdesc() somewhat.
Michael
2009-02-26 13:22:55 +01:00
Michael Adam
2fb944bde1 s3:registry: refactor deletion of value/secdesc/subkey list tdb records out
of regdb_store_values().

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
741e902888 s3:registry: streamline reg_deletekey() somewhat.
use W_ERROR_... macros and separate assignments from checks

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
4b444e4ac4 s3:registry: use create_reg_subkey() in reg_createkey().
Instead of calling store_reg_keys()

On my box, importing 2000 shares into an empty smbconf key
now takes some 32 seconds.

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
d73dafb5fe s3:registry: implement create_subkey for the smbconf backend
by delegating to the db backend

Michael
2009-02-26 13:22:54 +01:00
Michael Adam
20e40d3b7d s3:registry: implement create_subkey for the db backend.
Michael
2009-02-26 13:22:54 +01:00
Michael Adam
602bfeb360 s3:registry: add a create_subkey method to the backend ops.
This is to provide a more atomic means of adding a subkey of a key.

Michael
2009-02-26 13:22:54 +01:00
Michael Adam
0b22f8b99c s3:registry: hash the list of subkeys in the regsubkey_ctr
This removes many loops over all the arrays
(from regsubkey_ctr_key_exists) and thus
reduces "net conf drop" from 1m55 to 48seconds
and "net conf import" from 1m55 to 58 seconds
for 2000 shares on my box.

Michael
2009-02-26 13:22:54 +01:00
Michael Adam
149d94dd8f s3:registry: remove definition of regsubkey_ctr from the surface.
All access is now through accessor functions in reg_objects.c
This allows for performance tuning under the hood in the next step.

Michael
2009-02-26 13:22:53 +01:00
Michael Adam
1ce0035abb s3:registry: use regsubkey_ctr_init() in reg_eventlog.c
Michael
2009-02-26 13:22:53 +01:00
Michael Adam
69be6f5c1d s3:registry: use regsubkey_ctr_get_seqnum() in reg_backend_db.c
Michael
2009-02-26 13:22:53 +01:00
Michael Adam
8a74b535c8 s3:registry: use regsubkey_ctr_set_seqnum() in reg_backend_db.c
Michael
2009-02-26 13:22:53 +01:00
Michael Adam
3c15d053f5 s3:registry: use regsubkey_ctr_init() in reg_backend_db.c
instead of using talloc directly.

Michael
2009-02-26 13:22:53 +01:00
Michael Adam
ea2b74090d s3:registry: use regsubkey_ctr_init() in reg_api.c
instead of using talloc on struct regsubkey_ctr.

Michael
2009-02-26 13:22:52 +01:00
Michael Adam
cd8bfd3a84 s3:registry: add regsubkey_ctr_get_seqnum() to hide implementation
Michael
2009-02-26 13:22:52 +01:00
Michael Adam
63ed47c9e4 s3:registry: add regsubkey_ctr_set_seqnum to hide implementation from caller.
Michael
2009-02-26 13:22:52 +01:00
Michael Adam
763f41f39c s3:registry: add a regsubkey_ctr_init function for allocating a regsubkey_ctr
Michael
2009-02-26 13:22:51 +01:00
Michael Adam
060abd7e38 s3:registry: fix a comment
Michael
2009-02-26 13:22:51 +01:00
Michael Adam
63b576424d s3:registry: don't directly access key->subkeys->subkeys[] in reg_backend_db.c
Use the reg_objects accessor regsubkey_ctr_specific_key() instead.

Michael
2009-02-26 13:22:51 +01:00
Michael Adam
8c1e4034fe s3:registry: don't directly access key->subkeys->subkeys[] in reg_api.c
Use the reg_objects accessor regsubkey_ctr_specific_key() instead.

Michael
2009-02-26 13:22:51 +01:00
Michael Adam
62b53507d2 s3:registry: don't directly access key->subkeys->num_subkeys in reg_backend_db.
Use the reg_objects api instead.

Michael
2009-02-26 13:22:51 +01:00
Michael Adam
e05b7a8627 s3:registry: don't directly access key->subkeys->num_subkeys in reg_api.c
Use the reg_objects api instead.

Michael
2009-02-26 13:22:51 +01:00
Michael Adam
58fc61217d s3:registry: replace typedef "REGSUBKEY_CTR" by "struct regsubkey_ctr"
This paves the way for hiding the typedef and the implementation from the
surface.

Michael
2009-02-26 13:22:51 +01:00
Michael Adam
b56f449d6b Revert "Fix a O(n^2) algorithm in regdb_fetch_keys()"
This reverts commit a13f065bad.

This fix is reverted, because the speedup is going to move
further down into reg_objects.c. The unsorted list of subkey names
is going to be indexed: This O(n^2) search bites us in more places.
This re-establishes the abstraction of reg_objects.c.

Michael
2009-02-26 13:22:51 +01:00
Michael Adam
9f97674ef7 s3:registry: wrap deletekey_recursive in one big transaction.
This speeds up "net conf drop" with 2000 shares on my box from
4m40s to 1m50s, leaving virtually only cpu load.

Michael
2009-02-26 11:05:23 +01:00
Michael Adam
ba0e944c46 s3:registry: provide transaction_start|commit|cancel fns for the registry tdb
Michael
2009-02-26 11:05:22 +01:00
Volker Lendecke
170830c008 Wrap creating the sorted subkey cache in a transaction
Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:22 +01:00
Volker Lendecke
5c91cdcc47 Add a comment describing the sorted subkeys
Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:22 +01:00