mirror of
https://github.com/versity/scoutfs.git
synced 2025-12-23 13:35:18 +00:00
Add found_seq argument to scoutfs_btree_prev
Add a *found_seq argument to _prev so that it can give the caller the seq of the item that's returned. The extent code is going to use this to find seqs of extents. Signed-off-by: Zach Brown <zab@versity.com> Reviewed-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -1388,7 +1388,7 @@ int scoutfs_btree_since(struct super_block *sb,
|
||||
*/
|
||||
int scoutfs_btree_prev(struct super_block *sb, struct scoutfs_btree_root *root,
|
||||
struct scoutfs_key *first, struct scoutfs_key *last,
|
||||
struct scoutfs_key *found,
|
||||
struct scoutfs_key *found, u64 *found_seq,
|
||||
struct scoutfs_btree_val *val)
|
||||
{
|
||||
struct scoutfs_btree_item *item;
|
||||
@@ -1433,6 +1433,8 @@ int scoutfs_btree_prev(struct super_block *sb, struct scoutfs_btree_root *root,
|
||||
item = pos_item(bt, pos);
|
||||
if (cmp == 0 || scoutfs_key_cmp(&item->key, first) >= 0) {
|
||||
*found = item->key;
|
||||
if (found_seq)
|
||||
*found_seq = le64_to_cpu(item->seq);
|
||||
if (val)
|
||||
ret = copy_to_val(val, item);
|
||||
else
|
||||
|
||||
@@ -56,7 +56,7 @@ int scoutfs_btree_next(struct super_block *sb, struct scoutfs_btree_root *root,
|
||||
struct scoutfs_btree_val *val);
|
||||
int scoutfs_btree_prev(struct super_block *sb, struct scoutfs_btree_root *root,
|
||||
struct scoutfs_key *first, struct scoutfs_key *last,
|
||||
struct scoutfs_key *found,
|
||||
struct scoutfs_key *found, u64 *found_seq,
|
||||
struct scoutfs_btree_val *val);
|
||||
int scoutfs_btree_dirty(struct super_block *sb,
|
||||
struct scoutfs_btree_root *root,
|
||||
|
||||
Reference in New Issue
Block a user