projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b37fe1f
)
ceph: support getting ceph.dir.pin vxattr
author
Yan, Zheng
<zyan@redhat.com>
Wed, 9 Jan 2019 03:07:02 +0000
(11:07 +0800)
committer
Ilya Dryomov
<idryomov@gmail.com>
Tue, 5 Mar 2019 17:55:16 +0000
(18:55 +0100)
Link:
http://tracker.ceph.com/issues/37576
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/inode.c
patch
|
blob
|
history
fs/ceph/mds_client.c
patch
|
blob
|
history
fs/ceph/mds_client.h
patch
|
blob
|
history
fs/ceph/super.h
patch
|
blob
|
history
fs/ceph/xattr.c
patch
|
blob
|
history
diff --git
a/fs/ceph/inode.c
b/fs/ceph/inode.c
index
7f82cef
..
e6012de
100644
(file)
--- a/
fs/ceph/inode.c
+++ b/
fs/ceph/inode.c
@@
-877,6
+877,7
@@
static int fill_inode(struct inode *inode, struct page *locked_page,
ci->i_rbytes = le64_to_cpu(info->rbytes);
ci->i_rfiles = le64_to_cpu(info->rfiles);
ci->i_rsubdirs = le64_to_cpu(info->rsubdirs);
ci->i_rbytes = le64_to_cpu(info->rbytes);
ci->i_rfiles = le64_to_cpu(info->rfiles);
ci->i_rsubdirs = le64_to_cpu(info->rsubdirs);
+ ci->i_dir_pin = iinfo->dir_pin;
ceph_decode_timespec64(&ci->i_rctime, &info->rctime);
}
}
ceph_decode_timespec64(&ci->i_rctime, &info->rctime);
}
}
diff --git
a/fs/ceph/mds_client.c
b/fs/ceph/mds_client.c
index
e87544e
..
ddfb6a4
100644
(file)
--- a/
fs/ceph/mds_client.c
+++ b/
fs/ceph/mds_client.c
@@
-157,6
+157,13
@@
static int parse_reply_info_in(void **p, void *end,
ceph_decode_64_safe(p, end, change_attr, bad);
}
ceph_decode_64_safe(p, end, change_attr, bad);
}
+ /* dir pin */
+ if (struct_v >= 2) {
+ ceph_decode_32_safe(p, end, info->dir_pin, bad);
+ } else {
+ info->dir_pin = -ENODATA;
+ }
+
*p = end;
} else {
if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
*p = end;
} else {
if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
@@
-187,6
+194,8
@@
static int parse_reply_info_in(void **p, void *end,
*p += info->pool_ns_len;
}
}
*p += info->pool_ns_len;
}
}
+
+ info->dir_pin = -ENODATA;
}
return 0;
bad:
}
return 0;
bad:
diff --git
a/fs/ceph/mds_client.h
b/fs/ceph/mds_client.h
index
0919aac
..
af3b25e
100644
(file)
--- a/
fs/ceph/mds_client.h
+++ b/
fs/ceph/mds_client.h
@@
-68,6
+68,7
@@
struct ceph_mds_reply_info_in {
char *pool_ns_data;
u64 max_bytes;
u64 max_files;
char *pool_ns_data;
u64 max_bytes;
u64 max_files;
+ s32 dir_pin;
};
struct ceph_mds_reply_dir_entry {
};
struct ceph_mds_reply_dir_entry {
diff --git
a/fs/ceph/super.h
b/fs/ceph/super.h
index
5b15ae9
..
df44a77
100644
(file)
--- a/
fs/ceph/super.h
+++ b/
fs/ceph/super.h
@@
-318,6
+318,8
@@
struct ceph_inode_info {
/* quotas */
u64 i_max_bytes, i_max_files;
/* quotas */
u64 i_max_bytes, i_max_files;
+ s32 i_dir_pin;
+
struct rb_root i_fragtree;
int i_fragtree_nsplits;
struct mutex i_fragtree_mutex;
struct rb_root i_fragtree;
int i_fragtree_nsplits;
struct mutex i_fragtree_mutex;
diff --git
a/fs/ceph/xattr.c
b/fs/ceph/xattr.c
index
316f6ad
..
0cc42c8
100644
(file)
--- a/
fs/ceph/xattr.c
+++ b/
fs/ceph/xattr.c
@@
-228,8
+228,19
@@
static size_t ceph_vxattrcb_dir_rctime(struct ceph_inode_info *ci, char *val,
ci->i_rctime.tv_nsec);
}
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;
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),
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"),
{
.name = "ceph.quota",
.name_size = sizeof("ceph.quota"),