mirror of
https://github.com/versity/scoutfs.git
synced 2026-05-01 10:25:43 +00:00
scoutfs: remove unused xattr index code
Remove the last remnants of the indexed xattrs which used fs items. This makes the significant change of renumbering the key zones so I wanted it in its own commit. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -205,14 +205,12 @@ static inline const struct scoutfs_item_count SIC_RENAME(unsigned old_len,
|
||||
* item with the header and name. Any previously existing items are
|
||||
* deleted which dirties their key but removes their value. The two
|
||||
* sets of items are indexed by different ids so their items don't
|
||||
* overlap. If the xattr name is indexed then we modify one xattr index
|
||||
* item.
|
||||
* overlap.
|
||||
*/
|
||||
static inline const struct scoutfs_item_count SIC_XATTR_SET(unsigned old_parts,
|
||||
bool creating,
|
||||
unsigned name_len,
|
||||
unsigned size,
|
||||
bool indexed)
|
||||
unsigned size)
|
||||
{
|
||||
struct scoutfs_item_count cnt = {0,};
|
||||
unsigned int new_parts;
|
||||
@@ -221,8 +219,6 @@ static inline const struct scoutfs_item_count SIC_XATTR_SET(unsigned old_parts,
|
||||
|
||||
if (old_parts)
|
||||
cnt.items += old_parts;
|
||||
if (indexed)
|
||||
cnt.items++;
|
||||
|
||||
if (creating) {
|
||||
new_parts = SCOUTFS_XATTR_NR_PARTS(name_len, size);
|
||||
|
||||
@@ -121,11 +121,6 @@ struct scoutfs_key {
|
||||
#define skii_major _sk_second
|
||||
#define skii_ino _sk_third
|
||||
|
||||
/* xattr index */
|
||||
#define skxi_hash _sk_first
|
||||
#define skxi_ino _sk_second
|
||||
#define skxi_id _sk_third
|
||||
|
||||
/* node orphan inode */
|
||||
#define sko_rid _sk_first
|
||||
#define sko_ino _sk_second
|
||||
@@ -430,10 +425,9 @@ struct scoutfs_bloom_block {
|
||||
* Keys are first sorted by major key zones.
|
||||
*/
|
||||
#define SCOUTFS_INODE_INDEX_ZONE 1
|
||||
#define SCOUTFS_XATTR_INDEX_ZONE 2
|
||||
#define SCOUTFS_RID_ZONE 3
|
||||
#define SCOUTFS_FS_ZONE 4
|
||||
#define SCOUTFS_LOCK_ZONE 5
|
||||
#define SCOUTFS_RID_ZONE 2
|
||||
#define SCOUTFS_FS_ZONE 3
|
||||
#define SCOUTFS_LOCK_ZONE 4
|
||||
/* Items only stored in server btrees */
|
||||
#define SCOUTFS_LOG_TREES_ZONE 6
|
||||
#define SCOUTFS_LOCK_CLIENTS_ZONE 7
|
||||
@@ -446,9 +440,6 @@ struct scoutfs_bloom_block {
|
||||
#define SCOUTFS_INODE_INDEX_DATA_SEQ_TYPE 2
|
||||
#define SCOUTFS_INODE_INDEX_NR 3 /* don't forget to update */
|
||||
|
||||
/* xattr index zone */
|
||||
#define SCOUTFS_XATTR_INDEX_NAME_TYPE 1
|
||||
|
||||
/* rid zone (also used in server alloc btree) */
|
||||
#define SCOUTFS_ORPHAN_TYPE 1
|
||||
|
||||
|
||||
@@ -1208,24 +1208,6 @@ int scoutfs_lock_inode_index(struct super_block *sb, int mode,
|
||||
return lock_key_range(sb, mode, 0, &start, &end, ret_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Today we lock a hash value entirely. If we went to finer grained ino
|
||||
* locking as well we'd need to check the manifest to find the next
|
||||
* possible ino to lock so that we didn't try to iterate over all of
|
||||
* them.
|
||||
*/
|
||||
int scoutfs_lock_xattr_index(struct super_block *sb, int mode, int flags,
|
||||
u64 hash, struct scoutfs_lock **ret_lock)
|
||||
{
|
||||
struct scoutfs_key start;
|
||||
struct scoutfs_key end;
|
||||
|
||||
scoutfs_xattr_index_key(&start, hash, 0, 0);
|
||||
scoutfs_xattr_index_key(&end, hash, U64_MAX, U64_MAX);
|
||||
|
||||
return lock_key_range(sb, mode, flags, &start, &end, ret_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* The rid lock protects a mount's private persistent items in the rid
|
||||
* zone. It's held for the duration of the mount. It lets the mount
|
||||
|
||||
@@ -73,8 +73,6 @@ void scoutfs_lock_get_index_item_range(u8 type, u64 major, u64 ino,
|
||||
int scoutfs_lock_inode_index(struct super_block *sb, int mode,
|
||||
u8 type, u64 major, u64 ino,
|
||||
struct scoutfs_lock **ret_lock);
|
||||
int scoutfs_lock_xattr_index(struct super_block *sb, int mode, int flags,
|
||||
u64 hash, struct scoutfs_lock **ret_lock);
|
||||
int scoutfs_lock_inodes(struct super_block *sb, int mode, int flags,
|
||||
struct inode *a, struct scoutfs_lock **a_lock,
|
||||
struct inode *b, struct scoutfs_lock **b_lock,
|
||||
|
||||
@@ -136,17 +136,6 @@ static int parse_tags(const char *name, unsigned int name_len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void scoutfs_xattr_index_key(struct scoutfs_key *key,
|
||||
u64 hash, u64 ino, u64 id)
|
||||
{
|
||||
scoutfs_key_set_zeros(key);
|
||||
key->sk_zone = SCOUTFS_XATTR_INDEX_ZONE;
|
||||
key->skxi_hash = cpu_to_le64(hash);
|
||||
key->sk_type = SCOUTFS_XATTR_INDEX_NAME_TYPE;
|
||||
key->skxi_ino = cpu_to_le64(ino);
|
||||
key->skxi_id = cpu_to_le64(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the next xattr and copy the key, xattr header, and as much of
|
||||
* the name and value into the callers buffer as we can. Returns the
|
||||
@@ -502,8 +491,7 @@ retry:
|
||||
scoutfs_inode_index_try_lock_hold(sb, &ind_locks, ind_seq,
|
||||
SIC_XATTR_SET(found_parts,
|
||||
value != NULL,
|
||||
name_len, size,
|
||||
tgs.srch));
|
||||
name_len, size));
|
||||
if (ret > 0)
|
||||
goto retry;
|
||||
if (ret)
|
||||
|
||||
@@ -14,7 +14,4 @@ ssize_t scoutfs_list_xattrs(struct inode *inode, char *buffer,
|
||||
int scoutfs_xattr_drop(struct super_block *sb, u64 ino,
|
||||
struct scoutfs_lock *lock);
|
||||
|
||||
void scoutfs_xattr_index_key(struct scoutfs_key *key,
|
||||
u64 hash, u64 ino, u64 id);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user