diff options
Diffstat (limited to 'fs/ceph/super.h')
| -rw-r--r-- | fs/ceph/super.h | 72 | 
1 files changed, 54 insertions, 18 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 6014b0a3c40..12b20744e38 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -13,6 +13,7 @@  #include <linux/wait.h>  #include <linux/writeback.h>  #include <linux/slab.h> +#include <linux/posix_acl.h>  #include <linux/ceph/libceph.h> @@ -265,7 +266,6 @@ struct ceph_inode_info {  	struct timespec i_rctime;  	u64 i_rbytes, i_rfiles, i_rsubdirs;  	u64 i_files, i_subdirs; -	u64 i_max_offset;  /* largest readdir offset, set with complete dir */  	struct rb_root i_fragtree;  	struct mutex i_fragtree_mutex; @@ -287,9 +287,6 @@ struct ceph_inode_info {  	unsigned long i_hold_caps_min; /* jiffies */  	unsigned long i_hold_caps_max; /* jiffies */  	struct list_head i_cap_delay_list;  /* for delayed cap release to mds */ -	int i_cap_exporting_mds;         /* to handle cap migration between */ -	unsigned i_cap_exporting_mseq;   /*  mds's. */ -	unsigned i_cap_exporting_issued;  	struct ceph_cap_reservation i_cap_migration_resv;  	struct list_head i_cap_snaps;   /* snapped state pending flush to mds */  	struct ceph_snap_context *i_head_snapc;  /* set if wr_buffer_head > 0 or @@ -335,7 +332,6 @@ struct ceph_inode_info {  	u32 i_fscache_gen; /* sequence, for delayed fscache validate */  	struct work_struct i_revalidate_work;  #endif -  	struct inode vfs_inode; /* at end */  }; @@ -529,6 +525,8 @@ static inline int __ceph_caps_dirty(struct ceph_inode_info *ci)  }  extern int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask); +extern int __ceph_caps_revoking_other(struct ceph_inode_info *ci, +				      struct ceph_cap *ocap, int mask);  extern int ceph_caps_revoking(struct ceph_inode_info *ci, int mask);  extern int __ceph_caps_used(struct ceph_inode_info *ci); @@ -577,7 +575,7 @@ struct ceph_file_info {  	/* readdir: position within a frag */  	unsigned offset;       /* offset of last chunk, adjusted for . and .. */ -	u64 next_offset;       /* offset of next chunk (last_name's + 1) */ +	unsigned next_offset;  /* offset of next chunk (last_name's + 1) */  	char *last_name;       /* last entry in previous chunk */  	struct dentry *dentry; /* next dentry (for dcache readdir) */  	int dir_release_count; @@ -691,6 +689,7 @@ extern const struct inode_operations ceph_file_iops;  extern struct inode *ceph_alloc_inode(struct super_block *sb);  extern void ceph_destroy_inode(struct inode *inode); +extern int ceph_drop_inode(struct inode *inode);  extern struct inode *ceph_get_inode(struct super_block *sb,  				    struct ceph_vino vino); @@ -724,6 +723,9 @@ extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,  /* xattr.c */  extern int ceph_setxattr(struct dentry *, const char *, const void *,  			 size_t, int); +int __ceph_setxattr(struct dentry *, const char *, const void *, size_t, int); +ssize_t __ceph_getxattr(struct inode *, const char *, void *, size_t); +int __ceph_removexattr(struct dentry *, const char *);  extern ssize_t ceph_getxattr(struct dentry *, const char *, void *, size_t);  extern ssize_t ceph_listxattr(struct dentry *, char *, size_t);  extern int ceph_removexattr(struct dentry *, const char *); @@ -732,24 +734,57 @@ extern void __ceph_destroy_xattrs(struct ceph_inode_info *ci);  extern void __init ceph_xattr_init(void);  extern void ceph_xattr_exit(void); +/* acl.c */ +extern const struct xattr_handler *ceph_xattr_handlers[]; + +#ifdef CONFIG_CEPH_FS_POSIX_ACL + +struct posix_acl *ceph_get_acl(struct inode *, int); +int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type); +int ceph_init_acl(struct dentry *, struct inode *, struct inode *); + +static inline void ceph_forget_all_cached_acls(struct inode *inode) +{ +       forget_all_cached_acls(inode); +} + +#else + +#define ceph_get_acl NULL +#define ceph_set_acl NULL + +static inline int ceph_init_acl(struct dentry *dentry, struct inode *inode, +				struct inode *dir) +{ +	return 0; +} + +static inline int ceph_acl_chmod(struct dentry *dentry, struct inode *inode) +{ +	return 0; +} + +static inline void ceph_forget_all_cached_acls(struct inode *inode) +{ +} + +#endif +  /* caps.c */  extern const char *ceph_cap_string(int c);  extern void ceph_handle_caps(struct ceph_mds_session *session,  			     struct ceph_msg *msg); -extern int ceph_add_cap(struct inode *inode, -			struct ceph_mds_session *session, u64 cap_id, -			int fmode, unsigned issued, unsigned wanted, -			unsigned cap, unsigned seq, u64 realmino, int flags, -			struct ceph_cap_reservation *caps_reservation); -extern void __ceph_remove_cap(struct ceph_cap *cap); -static inline void ceph_remove_cap(struct ceph_cap *cap) -{ -	spin_lock(&cap->ci->i_ceph_lock); -	__ceph_remove_cap(cap); -	spin_unlock(&cap->ci->i_ceph_lock); -} +extern struct ceph_cap *ceph_get_cap(struct ceph_mds_client *mdsc, +				     struct ceph_cap_reservation *ctx); +extern void ceph_add_cap(struct inode *inode, +			 struct ceph_mds_session *session, u64 cap_id, +			 int fmode, unsigned issued, unsigned wanted, +			 unsigned cap, unsigned seq, u64 realmino, int flags, +			 struct ceph_cap **new_cap); +extern void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release);  extern void ceph_put_cap(struct ceph_mds_client *mdsc,  			 struct ceph_cap *cap); +extern int ceph_is_any_caps(struct inode *inode);  extern void __queue_cap_release(struct ceph_mds_session *session, u64 ino,  				u64 cap_id, u32 migrate_seq, u32 issue_seq); @@ -836,6 +871,7 @@ extern long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg);  extern const struct export_operations ceph_export_ops;  /* locks.c */ +extern __init void ceph_flock_init(void);  extern int ceph_lock(struct file *file, int cmd, struct file_lock *fl);  extern int ceph_flock(struct file *file, int cmd, struct file_lock *fl);  extern void ceph_count_locks(struct inode *inode, int *p_num, int *f_num);  | 
