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:
Zach Brown
2016-11-15 12:39:32 -08:00
parent ae6cc83d01
commit af5955e95a
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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,