Files
scoutfs/kmod/src/dir.h
Zach Brown 65c3ac5043 scoutfs: Add cluster locking to node/file ops
This gives us cluster locking for the overwhelming majority of metadata ops
that scoutfs supports. In particular, we can create and modify file metadata
from one node and immediately see the changes reflected on another node.

In addition to synchonrization the cluster locks here are providing an I/O
endpoint for our item cache, ensuring that it doesn't read stale items.

Readdir and file read/write are notable exception - they require a more
specific approach and will be implemented in a future patch.

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
[fixed iget unlock and truncated commit message summary]
Signed-off-by: Zach Brown <zab@versity.com>
2017-08-03 11:16:35 -07:00

30 lines
783 B
C

#ifndef _SCOUTFS_DIR_H_
#define _SCOUTFS_DIR_H_
#include "format.h"
#include "lock.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,
struct scoutfs_lock *lock, u64 i_size);
int scoutfs_dir_init(void);
void scoutfs_dir_exit(void);
#endif