History log of /haiku/src/kits/storage/Query.cpp
Revision Date Author Comments
# 2532a287 23-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

Avoid using unions for LongDirEntry.

GCC still assumes that the dirent has no data past the end for some
scenarios here and still mis-optimizes things. Therefore, drop the
usages of unions altogether, and instead use a casted character array.

Additionally, use B_FILE_NAME_LENGTH for the array, not B_PATH_NAME_LENGTH,
and make sure to add 1 for the NULL terminator.


# 8f03af00 18-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

Storage: Rework LongDirEntry to be a union.

Our dirent structure is "slim": it has a flexible-length array at the
end which must be allocated to whatever size the consumer wants. However,
we use [1] there and not [0] or [], which meant GCC thought it was not
a flexible-length array, and so it optimized various string accesses
that it assumed must be always false. Among these was BDirectory's
check for "." and "..", and so that resulted in infinite loops.

When changing our dirent structure to a proper FLA instead of [1],
GCC then throws errors on LongDirEntry as it has data "after" the
FLA; which is what we want, but there is no way to tell GCC that.
So now we use a union instead, which is the proper way to statically
allocate a FLA.

This is part of #17389, but the real fix requires changing our dirent
structure, which is coming in a separate commit.


# a30a4a41 18-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to Storage Kit classes.

No functional changes intended.

* Some variable renaming for clarity and consistency.
* Pointer style fixes.
* Added private method documentation back to cpp files for some methods.


# 0a9ac70a 14-Feb-2013 John Scipione <jscipione@gmail.com>

Move BQuery docs into Haiku Book.

... removing the docs from the .cpp and .h files and cleaning up as usual.


# 4a5a077f 24-Oct-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a private B_ATTR_CHANGE_NOTIFICATION flag to the open query syscall to tell the query to send notifications when an entry attribute changed and the entry stays in the query. Previously you only get created and removed messages, now you can also get updated messages. Only implement it for bfs.
Fix copy right.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39131 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8e5a675 23-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Implemented missing date parsing; queries like "last_modified > %-5 minutes%"
are now working as they should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31711 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8315ac24 23-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31710 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b06942c6 13-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

All internally used FDs are now set to O_CLOEXEC.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 450b5c2c 12-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Reverted the last change. As Axel informed me, rewinding queries will work under Haiku. Also check, whether the query was Fetch()ed already.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10698 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0660acfd 11-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Must have accidently implemented BQuery::Rewind() when migrating to our syscalls.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10681 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d875b05 12-Dec-2004 Axel Dörfler <axeld@pinc-software.de>

Adapted because of the changes made to _kern_open_query().
Implemented BQuery::Rewind() - there is no reason not to do this, as the
kernel has no extra work because of this.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10400 a95241bf-73f2-0310-859d-f6bbb57e9c96


# db10640d 28-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Got rid of the Storage Kit's kernel abstraction layer, which was
unfortunately quite slow and made some things more complicated than they
needed to be.
Implemented a few missing things (e.g. BSymLink and node locking).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8694 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e6de7a 03-Aug-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98833b15 11-Jun-2003 haydentech <haydentech@nowhere.fake>

Cleaned-up the std namespace support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a0a3f269 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace- and gcc3-related fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 32b8ee2e 26-Oct-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Renamed reserved functions to match those in R5, due to linking
incompatibilities that appear to possibly be due to R5 versions
of tests in libstoragetest_r5.so being compiled with our headers...

At any rate, this appears to fix the BQuery linking problems.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1712 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef753322 16-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Updated BQuery's BMessenger hack to be more legit (and
to allow libstorage to compile using public app kit headers)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@783 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09d84e61 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a30a4a41f948ebb03b95dab065a27a584ac0c97a 18-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to Storage Kit classes.

No functional changes intended.

* Some variable renaming for clarity and consistency.
* Pointer style fixes.
* Added private method documentation back to cpp files for some methods.


# 0a9ac70aeaf2ced3be4b252416d7e68972c7f5ce 14-Feb-2013 John Scipione <jscipione@gmail.com>

Move BQuery docs into Haiku Book.

... removing the docs from the .cpp and .h files and cleaning up as usual.


# 4a5a077ff79e1b1ffb2571fdfc5ea8218a64196c 24-Oct-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a private B_ATTR_CHANGE_NOTIFICATION flag to the open query syscall to tell the query to send notifications when an entry attribute changed and the entry stays in the query. Previously you only get created and removed messages, now you can also get updated messages. Only implement it for bfs.
Fix copy right.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39131 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8e5a675e5d917ff4f9ce27872c59f617cbdbc8f 23-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Implemented missing date parsing; queries like "last_modified > %-5 minutes%"
are now working as they should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31711 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8315ac2417baa2afa8df3f36d2e6fda690dfc0a2 23-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31710 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b06942c6049d167350529b36a6f7f559383a764f 13-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

All internally used FDs are now set to O_CLOEXEC.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 450b5c2c69ede24477ddba1ac74e87b5302a76fa 12-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Reverted the last change. As Axel informed me, rewinding queries will work under Haiku. Also check, whether the query was Fetch()ed already.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10698 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0660acfd9c0e1ba3812d6d8436ca65cb7b7dbf9a 11-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Must have accidently implemented BQuery::Rewind() when migrating to our syscalls.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10681 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d875b05251295f4f0c98bc8a08f6142ad36fcea 12-Dec-2004 Axel Dörfler <axeld@pinc-software.de>

Adapted because of the changes made to _kern_open_query().
Implemented BQuery::Rewind() - there is no reason not to do this, as the
kernel has no extra work because of this.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10400 a95241bf-73f2-0310-859d-f6bbb57e9c96


# db10640de90f7f9519ba2da9577b7c1af3c64f6b 28-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Got rid of the Storage Kit's kernel abstraction layer, which was
unfortunately quite slow and made some things more complicated than they
needed to be.
Implemented a few missing things (e.g. BSymLink and node locking).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8694 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e6de7a37c5c61f45eb724de108daa70905cb8f 03-Aug-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98833b15bf4967b0b12fda60065cda7ac83e091d 11-Jun-2003 haydentech <haydentech@nowhere.fake>

Cleaned-up the std namespace support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a0a3f269a4eae19d6fdbffdb581e888219988160 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace- and gcc3-related fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 32b8ee2e940cad78263723c8fd52062db2478dea 26-Oct-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Renamed reserved functions to match those in R5, due to linking
incompatibilities that appear to possibly be due to R5 versions
of tests in libstoragetest_r5.so being compiled with our headers...

At any rate, this appears to fix the BQuery linking problems.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1712 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef753322a82ff627ad7ef491ee426d5ecb80d937 16-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Updated BQuery's BMessenger hack to be more legit (and
to allow libstorage to compile using public app kit headers)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@783 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09d84e61b6c2629d253dce1e7d7e944943d3e40e 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96