const struct inode_operations ceph_dir_iops = {
.lookup = ceph_lookup,
+ .permission = ceph_permission,
.getattr = ceph_getattr,
.setattr = ceph_setattr,
.setxattr = ceph_setxattr,
const struct inode_operations ceph_file_iops = {
+ .permission = ceph_permission,
.setattr = ceph_setattr,
.getattr = ceph_getattr,
.setxattr = ceph_setxattr,
return err;
}
+
+/*
+ * Check inode permissions. We verify we have a valid value for
+ * the AUTH cap, then call the generic handler.
+ */
+int ceph_permission(struct inode *inode, int mask)
+{
+ int err = ceph_do_getattr(inode, CEPH_CAP_AUTH_RDCACHE);
+
+ if (!err)
+ err = generic_permission(inode, mask, NULL);
+ return err;
+}
+
/*
* Get all attributes. Hopefully somedata we'll have a statlite()
* and can limit the fields we require to be accurate.
extern void __ceph_do_pending_vmtruncate(struct inode *inode);
extern int ceph_do_getattr(struct inode *inode, int mask);
+extern int ceph_permission(struct inode *inode, int mask);
extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat);