]> Git Repo - linux.git/blobdiff - fs/ceph/xattr.c
Merge tag 'fsdax-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[linux.git] / fs / ceph / xattr.c
index 316f6ad10644cdce8fd5cd7fbe526b3293a0866e..0cc42c8879e9a0c266405100a13b474489e91b32 100644 (file)
@@ -228,8 +228,19 @@ static size_t ceph_vxattrcb_dir_rctime(struct ceph_inode_info *ci, char *val,
                        ci->i_rctime.tv_nsec);
 }
 
-/* quotas */
+/* dir pin */
+static bool ceph_vxattrcb_dir_pin_exists(struct ceph_inode_info *ci)
+{
+       return ci->i_dir_pin != -ENODATA;
+}
+
+static size_t ceph_vxattrcb_dir_pin(struct ceph_inode_info *ci, char *val,
+                                    size_t size)
+{
+       return snprintf(val, size, "%d", (int)ci->i_dir_pin);
+}
 
+/* quotas */
 static bool ceph_vxattrcb_quota_exists(struct ceph_inode_info *ci)
 {
        bool ret = false;
@@ -314,6 +325,13 @@ static struct ceph_vxattr ceph_dir_vxattrs[] = {
        XATTR_RSTAT_FIELD(dir, rsubdirs),
        XATTR_RSTAT_FIELD(dir, rbytes),
        XATTR_RSTAT_FIELD(dir, rctime),
+       {
+               .name = "ceph.dir.pin",
+               .name_size = sizeof("ceph.dir_pin"),
+               .getxattr_cb = ceph_vxattrcb_dir_pin,
+               .exists_cb = ceph_vxattrcb_dir_pin_exists,
+               .flags = VXATTR_FLAG_HIDDEN,
+       },
        {
                .name = "ceph.quota",
                .name_size = sizeof("ceph.quota"),
This page took 0.031251 seconds and 4 git commands to generate.