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 int reiser4_setattr_common(struct dentry
*, struct iattr
*);
30 int reiser4_getattr_common(struct vfsmount
*mnt
, struct dentry
*,
33 /* common implementations of file operations */
34 loff_t
reiser4_llseek_dir_common(struct file
*, loff_t off
, int origin
);
35 int reiser4_readdir_common(struct file
*, void *dirent
, filldir_t
);
36 int reiser4_release_dir_common(struct inode
*, struct file
*);
37 int reiser4_sync_common(struct file
*, struct dentry
*, int datasync
);
40 /* file plugin operations: common implementations */
41 int write_sd_by_inode_common(struct inode
*);
42 int key_by_inode_and_offset_common(struct inode
*, loff_t
, reiser4_key
*);
43 int set_plug_in_inode_common(struct inode
*object
, struct inode
*parent
,
44 reiser4_object_create_data
*);
45 int adjust_to_parent_common(struct inode
*object
, struct inode
*parent
,
47 int adjust_to_parent_common_dir(struct inode
*object
, struct inode
*parent
,
49 int adjust_to_parent_cryptcompress(struct inode
*object
, struct inode
*parent
,
51 int reiser4_create_object_common(struct inode
*object
, struct inode
*parent
,
52 reiser4_object_create_data
*);
53 int reiser4_delete_object_common(struct inode
*);
54 int reiser4_delete_dir_common(struct inode
*);
55 int reiser4_add_link_common(struct inode
*object
, struct inode
*parent
);
56 int reiser4_rem_link_common(struct inode
*object
, struct inode
*parent
);
57 int rem_link_common_dir(struct inode
*object
, struct inode
*parent
);
58 int owns_item_common(const struct inode
*, const coord_t
*);
59 int owns_item_common_dir(const struct inode
*, const coord_t
*);
60 int can_add_link_common(const struct inode
*);
61 int can_rem_link_common_dir(const struct inode
*);
62 int reiser4_detach_common_dir(struct inode
*child
, struct inode
*parent
);
63 int reiser4_bind_common_dir(struct inode
*child
, struct inode
*parent
);
64 int safelink_common(struct inode
*, reiser4_safe_link_t
, __u64 value
);
65 reiser4_block_nr
estimate_create_common(const struct inode
*);
66 reiser4_block_nr
estimate_create_common_dir(const struct inode
*);
67 reiser4_block_nr
estimate_update_common(const struct inode
*);
68 reiser4_block_nr
estimate_unlink_common(const struct inode
*,
69 const struct inode
*);
70 reiser4_block_nr
estimate_unlink_common_dir(const struct inode
*,
71 const struct inode
*);
72 char *wire_write_common(struct inode
*, char *start
);
73 char *wire_read_common(char *addr
, reiser4_object_on_wire
*);
74 struct dentry
*wire_get_common(struct super_block
*, reiser4_object_on_wire
*);
75 int wire_size_common(struct inode
*);
76 void wire_done_common(reiser4_object_on_wire
*);
78 /* dir plugin operations: common implementations */
79 struct dentry
*get_parent_common(struct inode
*child
);
80 int is_name_acceptable_common(const struct inode
*, const char *name
, int len
);
81 void build_entry_key_common(const struct inode
*,
82 const struct qstr
*qname
, reiser4_key
*);
83 int build_readdir_key_common(struct file
*dir
, reiser4_key
*);
84 int reiser4_add_entry_common(struct inode
*object
, struct dentry
*where
,
85 reiser4_object_create_data
* , reiser4_dir_entry_desc
*);
86 int reiser4_rem_entry_common(struct inode
*object
, struct dentry
*where
,
87 reiser4_dir_entry_desc
*);
88 int reiser4_dir_init_common(struct inode
*object
, struct inode
*parent
,
89 reiser4_object_create_data
*);
90 int reiser4_dir_done_common(struct inode
*);
91 int reiser4_attach_common(struct inode
*child
, struct inode
*parent
);
92 int reiser4_detach_common(struct inode
*object
, struct inode
*parent
);
93 reiser4_block_nr
estimate_add_entry_common(const struct inode
*);
94 reiser4_block_nr
estimate_rem_entry_common(const struct inode
*);
95 reiser4_block_nr
dir_estimate_unlink_common(const struct inode
*,
96 const struct inode
*);
98 /* these are essential parts of common implementations, they are to make
99 customized implementations easier */
100 int do_prepare_write(struct file
*, struct page
*, unsigned from
, unsigned to
);
102 /* merely useful functions */
103 int lookup_sd(struct inode
*, znode_lock_mode
, coord_t
*, lock_handle
* ,
104 const reiser4_key
* , int silent
);
106 /* __FS_REISER4_PLUGIN_OBJECT_H__ */
111 c-indentation-style: "K&R"