summaryrefslogtreecommitdiff
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2020-04-07 13:30:20 +0300
committerIlya Dryomov <idryomov@gmail.com>2020-06-01 14:22:53 +0300
commitdffdcd71458e699e839f0bf47c3d42d64210b939 (patch)
tree27649741f8a1fab8fca00cc7f68c4cb59e73d936 /fs/ceph/super.h
parentdaa668fbacfdb9147b1828fc0f97b685bf4a51e3 (diff)
downloadlinux-dffdcd71458e699e839f0bf47c3d42d64210b939.tar.xz
ceph: allow rename operation under different quota realms
Returning -EXDEV when trying to 'mv' files/directories from different quota realms results in copy+unlink operations instead of the faster CEPH_MDS_OP_RENAME. This will occur even when there aren't any quotas set in the destination directory, or if there's enough space left for the new file(s). This patch adds a new helper function to be called on rename operations which will allow these operations if they can be executed. This patch mimics userland fuse client commit b8954e5734b3 ("client: optimize rename operation under different quota root"). Since ceph_quota_is_same_realm() is now called only from this new helper, make it static. URL: https://tracker.ceph.com/issues/44791 Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index b82f82d8213a..226f19c9042f 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -1210,13 +1210,14 @@ extern void ceph_handle_quota(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session,
struct ceph_msg *msg);
extern bool ceph_quota_is_max_files_exceeded(struct inode *inode);
-extern bool ceph_quota_is_same_realm(struct inode *old, struct inode *new);
extern bool ceph_quota_is_max_bytes_exceeded(struct inode *inode,
loff_t newlen);
extern bool ceph_quota_is_max_bytes_approaching(struct inode *inode,
loff_t newlen);
extern bool ceph_quota_update_statfs(struct ceph_fs_client *fsc,
struct kstatfs *buf);
+extern int ceph_quota_check_rename(struct ceph_mds_client *mdsc,
+ struct inode *old, struct inode *new);
extern void ceph_cleanup_quotarealms_inodes(struct ceph_mds_client *mdsc);
#endif /* _FS_CEPH_SUPER_H */