From cda85b2954dfd1c9ef116de0e8a9693855a5de99 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 16 Jul 2009 14:25:11 -0700 Subject: [PATCH] kclient: super.c cleanup --- src/kernel/caps.c | 5 +++-- src/kernel/mds_client.c | 6 +++--- src/kernel/mds_client.h | 6 +++--- src/kernel/super.c | 7 +++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/kernel/caps.c b/src/kernel/caps.c index 94d389461b346..c7be92cc15c67 100644 --- a/src/kernel/caps.c +++ b/src/kernel/caps.c @@ -884,13 +884,14 @@ void ceph_queue_caps_release(struct inode *inode) session->s_num_cap_releases--; msg->front.iov_len += sizeof(*item); - if (le32_to_cpu(head->num) == CAPS_PER_RELEASE) { + if (le32_to_cpu(head->num) == CEPH_CAPS_PER_RELEASE) { dout(" release msg %p full\n", msg); list_move_tail(&msg->list_head, &session->s_cap_releases_done); } else { dout(" release msg %p at %d/%d (%d)\n", msg, - (int)le32_to_cpu(head->num), (int)CAPS_PER_RELEASE, + (int)le32_to_cpu(head->num), + (int)CEPH_CAPS_PER_RELEASE, (int)msg->front.iov_len); } spin_unlock(&session->s_cap_lock); diff --git a/src/kernel/mds_client.c b/src/kernel/mds_client.c index 19e0c72ded873..11f43c8e42a2d 100644 --- a/src/kernel/mds_client.c +++ b/src/kernel/mds_client.c @@ -886,7 +886,7 @@ static int add_cap_releases(struct ceph_mds_client *mdsc, struct ceph_msg, list_head); head = msg->front.iov_base; - extra += CAPS_PER_RELEASE - le32_to_cpu(head->num); + extra += CEPH_CAPS_PER_RELEASE - le32_to_cpu(head->num); } while (session->s_num_cap_releases < session->s_nr_caps + extra) { @@ -902,7 +902,7 @@ static int add_cap_releases(struct ceph_mds_client *mdsc, msg->front.iov_len = sizeof(*head); spin_lock(&session->s_cap_lock); list_add(&msg->list_head, &session->s_cap_releases); - session->s_num_cap_releases += CAPS_PER_RELEASE; + session->s_num_cap_releases += CEPH_CAPS_PER_RELEASE; } if (!list_empty(&session->s_cap_releases)) { @@ -916,7 +916,7 @@ static int add_cap_releases(struct ceph_mds_client *mdsc, list_move_tail(&msg->list_head, &session->s_cap_releases_done); session->s_num_cap_releases -= - CAPS_PER_RELEASE - le32_to_cpu(head->num); + CEPH_CAPS_PER_RELEASE - le32_to_cpu(head->num); } } err = 0; diff --git a/src/kernel/mds_client.h b/src/kernel/mds_client.h index b7f78a6bd1a58..5a4db3332d12d 100644 --- a/src/kernel/mds_client.h +++ b/src/kernel/mds_client.h @@ -105,9 +105,9 @@ enum { CEPH_MDS_SESSION_RECONNECTING = 6 }; -#define CAPS_PER_RELEASE ((PAGE_CACHE_SIZE - \ - sizeof(struct ceph_mds_cap_release)) / \ - sizeof(struct ceph_mds_cap_item)) +#define CEPH_CAPS_PER_RELEASE ((PAGE_CACHE_SIZE - \ + sizeof(struct ceph_mds_cap_release)) / \ + sizeof(struct ceph_mds_cap_item)) struct ceph_mds_session { int s_mds; diff --git a/src/kernel/super.c b/src/kernel/super.c index 311a1ca583dbd..5bf56f3290a08 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -475,7 +475,7 @@ static int parse_mount_args(int flags, char *options, const char *dev_name, args->caps_wanted_delay_min = CEPH_CAPS_WANTED_DELAY_MIN_DEFAULT; args->caps_wanted_delay_max = CEPH_CAPS_WANTED_DELAY_MAX_DEFAULT; args->snapdir_name = ".snap"; - args->cap_release_safety = CAPS_PER_RELEASE * 4; + args->cap_release_safety = CEPH_CAPS_PER_RELEASE * 4; args->max_readdir = 1024; /* ip1[:port1][,ip2[:port2]...]:/subdir/in/fs */ @@ -737,7 +737,7 @@ static struct dentry *open_root_dentry(struct ceph_client *client, } /* - * mount: join the ceph cluster. + * mount: join the ceph cluster, and open root directory. */ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt, const char *path) @@ -957,9 +957,8 @@ static int ceph_compare_super(struct super_block *sb, void *data) struct ceph_mount_args *args = &new->mount_args; struct ceph_client *other = ceph_sb_to_client(sb); int i; - dout("ceph_compare_super %p\n", sb); - /* either compare fsid, or specified mon_hostname */ + dout("ceph_compare_super %p\n", sb); if (args->flags & CEPH_OPT_FSID) { if (ceph_fsid_compare(&args->fsid, &other->fsid)) { dout("fsid doesn't match\n"); -- 2.39.5