Files
scoutfs/kmod/src/dir.h
T
Zach Brown fff6fb4740 Restore link backref items
Convert the link backref code from btree items to the item cache.

Now that the backref items have the full entry name we can traverse a
link with one item lookup.  We don't need to lock the inode and verify
that the entry at the backref offset really points to our inode.  The
link backref walk gets a lot simpler.

But we have to widen the ioctl cursor to store a full dir ino and path
name isntead of just the dir's backref counter.

Signed-off-by: Zach Brown <zab@versity.com>
2017-04-18 13:44:54 -07:00

28 lines
722 B
C

#ifndef _SCOUTFS_DIR_H_
#define _SCOUTFS_DIR_H_
#include "format.h"
extern const struct file_operations scoutfs_dir_fops;
extern const struct inode_operations scoutfs_dir_iops;
extern const struct inode_operations scoutfs_symlink_iops;
struct scoutfs_link_backref_entry {
struct list_head head;
u16 name_len;
struct scoutfs_link_backref_key lbkey;
};
int scoutfs_dir_get_backref_path(struct super_block *sb, u64 target_ino,
u64 dir_ino, char *name, u16 name_len,
struct list_head *list);
void scoutfs_dir_free_backref_path(struct super_block *sb,
struct list_head *list);
int scoutfs_symlink_drop(struct super_block *sb, u64 ino);
int scoutfs_dir_init(void);
void scoutfs_dir_exit(void);
#endif