1 /* Copyright 2002, 2003 by Hans Reiser, licensing governed by
4 /* Declaration of object plugin functions. */
6 #if !defined( __FS_REISER4_PLUGIN_OBJECT_H__ )
7 #define __FS_REISER4_PLUGIN_OBJECT_H__
9 #include "../type_safe_hash.h"
11 /* common implementations of inode operations */
12 int reiser4_create_common(struct inode
*parent
, struct dentry
*dentry
,
13 int mode
, struct nameidata
*);
14 struct dentry
* reiser4_lookup_common(struct inode
*parent
,
15 struct dentry
*dentry
,
16 struct nameidata
*nameidata
);
17 int reiser4_link_common(struct dentry
*existing
, struct inode
*parent
,
18 struct dentry
*newname
);
19 int reiser4_unlink_common(struct inode
*parent
, struct dentry
*victim
);
20 int reiser4_mkdir_common(struct inode
*parent
, struct dentry
*dentry
, int mode
);
21 int reiser4_symlink_common(struct inode
*parent
, struct dentry
*dentry
,
22 const char *linkname
);
23 int reiser4_mknod_common(struct inode
*parent
, struct dentry
*dentry
,
24 int mode
, dev_t rdev
);
25 int reiser4_rename_common(struct inode
*old_dir
, struct dentry
*old_name
,
26 struct inode
*new_dir
, struct dentry
*new_name
);
27 void *reiser4_follow_link_common(struct dentry
*, struct nameidata
*data
);
28 int reiser4_permission_common(struct inode
*, int mask
,
29 struct nameidata
*nameidata
);
30 int reiser4_setattr_common(struct dentry
*, struct iattr
*);
31 int reiser4_getattr_common(struct vfsmount
*mnt
, struct dentry
*,
34 /* common implementations of file operations */
35 loff_t
reiser4_llseek_dir_common(struct file
*, loff_t off
, int origin
);
36 int reiser4_readdir_common(struct file
*, void *dirent
, filldir_t
);
37 int reiser4_release_dir_common(struct inode
*, struct file
*);
38 int reiser4_sync_common(struct file
*, struct dentry
*, int datasync
);
40 /* common implementations of address space operations */
41 int prepare_write_common(struct file
*, struct page
*, unsigned from
,
44 /* file plugin operations: common implementations */
45 int write_sd_by_inode_common(struct inode
*);
46 int key_by_inode_and_offset_common(struct inode
*, loff_t
, reiser4_key
*);
47 int set_plug_in_inode_common(struct inode
*object
, struct inode
*parent
,
48 reiser4_object_create_data
*);
49 int adjust_to_parent_common(struct inode
*object
, struct inode
*parent
,
51 int adjust_to_parent_common_dir(struct inode
*object
, struct inode
*parent
,
53 int adjust_to_parent_cryptcompress(struct inode
*object
, struct inode
*parent
,
55 int reiser4_create_object_common(struct inode
*object
, struct inode
*parent
,
56 reiser4_object_create_data
*);
57 int reiser4_delete_object_common(struct inode
*);
58 int reiser4_delete_dir_common(struct inode
*);
59 int reiser4_add_link_common(struct inode
*object
, struct inode
*parent
);
60 int reiser4_rem_link_common(struct inode
*object
, struct inode
*parent
);
61 int rem_link_common_dir(struct inode
*object
, struct inode
*parent
);
62 int owns_item_common(const struct inode
*, const coord_t
*);
63 int owns_item_common_dir(const struct inode
*, const coord_t
*);
64 int can_add_link_common(const struct inode
*);
65 int can_rem_link_common_dir(const struct inode
*);
66 int reiser4_detach_common_dir(struct inode
*child
, struct inode
*parent
);
67 int reiser4_bind_common_dir(struct inode
*child
, struct inode
*parent
);
68 int safelink_common(struct inode
*, reiser4_safe_link_t
, __u64 value
);
69 reiser4_block_nr
estimate_create_common(const struct inode
*);
70 reiser4_block_nr
estimate_create_common_dir(const struct inode
*);
71 reiser4_block_nr
estimate_update_common(const struct inode
*);
72 reiser4_block_nr
estimate_unlink_common(const struct inode
*,
73 const struct inode
*);
74 reiser4_block_nr
estimate_unlink_common_dir(const struct inode
*,
75 const struct inode
*);
76 char *wire_write_common(struct inode
*, char *start
);
77 char *wire_read_common(char *addr
, reiser4_object_on_wire
*);
78 struct dentry
*wire_get_common(struct super_block
*, reiser4_object_on_wire
*);
79 int wire_size_common(struct inode
*);
80 void wire_done_common(reiser4_object_on_wire
*);
82 /* dir plugin operations: common implementations */
83 struct dentry
*get_parent_common(struct inode
*child
);
84 int is_name_acceptable_common(const struct inode
*, const char *name
, int len
);
85 void build_entry_key_common(const struct inode
*,
86 const struct qstr
*qname
, reiser4_key
*);
87 int build_readdir_key_common(struct file
*dir
, reiser4_key
*);
88 int reiser4_add_entry_common(struct inode
*object
, struct dentry
*where
,
89 reiser4_object_create_data
*, reiser4_dir_entry_desc
*);
90 int reiser4_rem_entry_common(struct inode
*object
, struct dentry
*where
,
91 reiser4_dir_entry_desc
*);
92 int reiser4_dir_init_common(struct inode
*object
, struct inode
*parent
,
93 reiser4_object_create_data
*);
94 int reiser4_dir_done_common(struct inode
*);
95 int reiser4_attach_common(struct inode
*child
, struct inode
*parent
);
96 int reiser4_detach_common(struct inode
*object
, struct inode
*parent
);
97 reiser4_block_nr
estimate_add_entry_common(const struct inode
*);
98 reiser4_block_nr
estimate_rem_entry_common(const struct inode
*);
99 reiser4_block_nr
dir_estimate_unlink_common(const struct inode
*,
100 const struct inode
*);
102 /* these are essential parts of common implementations, they are to make
103 customized implementations easier */
104 int do_prepare_write(struct file
*, struct page
*, unsigned from
, unsigned to
);
106 /* merely useful functions */
107 int lookup_sd(struct inode
*, znode_lock_mode
, coord_t
*, lock_handle
*,
108 const reiser4_key
*, int silent
);
110 /* __FS_REISER4_PLUGIN_OBJECT_H__ */
115 c-indentation-style: "K&R"