]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cleanup
authorYehuda Sadeh-Weinraub <yehuda@yehuda.infit.com>
Wed, 23 Jan 2008 08:05:28 +0000 (10:05 +0200)
committerYehuda Sadeh-Weinraub <yehuda@yehuda.infit.com>
Wed, 23 Jan 2008 08:05:28 +0000 (10:05 +0200)
src/kernel/dir.c
src/kernel/file.c
src/kernel/inode.c
src/kernel/mds_client.c
src/kernel/super.c
src/kernel/super.h

index d5c5759331b78ee6210994e39af624544c7d9c18..70a61276cfe22f2d79ab068668f72648119c279e 100644 (file)
@@ -238,7 +238,7 @@ const struct file_operations ceph_dir_fops = {
 static struct dentry *ceph_dir_lookup(struct inode *dir, struct dentry *dentry,
                                      struct nameidata *nd)
 {
-       struct ceph_client *client = dir->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        char *path;
        int pathlen;
@@ -308,7 +308,7 @@ static struct dentry *ceph_dir_lookup(struct inode *dir, struct dentry *dentry,
 
 static int ceph_dir_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
 {
-       struct ceph_client *client = dir->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        struct inode *inode = NULL;
        struct ceph_msg *req;
@@ -358,7 +358,7 @@ done:
 
 static int ceph_dir_symlink(struct inode *dir, struct dentry *dentry, const char *dest)
 {
-       struct ceph_client *client = dir->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        struct inode *inode = NULL;
        struct ceph_msg *req;
@@ -404,7 +404,7 @@ done:
 
 static int ceph_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 {
-       struct ceph_client *client = dir->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        struct inode *inode = NULL;
        struct ceph_msg *req;
@@ -455,7 +455,7 @@ done_mkdir:
 
 static int ceph_dir_unlink(struct inode *dir, struct dentry *dentry)
 {
-       struct ceph_client *client = dir->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        struct inode *inode = dentry->d_inode;
        struct ceph_msg *req;
@@ -488,7 +488,7 @@ static int ceph_dir_unlink(struct inode *dir, struct dentry *dentry)
 static int ceph_dir_rename(struct inode *old_dir, struct dentry *old_dentry,
                           struct inode *new_dir, struct dentry *new_dentry)
 {
-       struct ceph_client *client = old_dir->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(old_dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        struct ceph_msg *req;
        struct ceph_mds_reply_info rinfo;
index c4a88c9f07c25c27d5c90cf810c46549fe34b8b1..eab68a8d7db869d4ab8dd34c4b8ae579c71eb126 100644 (file)
@@ -12,7 +12,7 @@ int ceph_debug_file = 50;
 int do_open_request(struct super_block *sb, struct dentry *dentry, int flags, int create_mode, 
                    struct ceph_mds_session **psession, struct ceph_mds_reply_info *rinfo)
 {
-       struct ceph_client *client = sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
        ceph_ino_t pathbase;
        char *path;
index 4c724fd4c5f2bafa5f9f71b3997e7db6dd0dc600..0a45fa336edc6a98b4fdde2d372c2238618e8541 100644 (file)
@@ -478,7 +478,7 @@ struct ceph_msg * prepare_setattr(struct ceph_mds_client *mdsc, struct dentry *d
 int ceph_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = dentry->d_inode;
-       struct ceph_client *client = inode->i_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(inode->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
         const unsigned int ia_valid = attr->ia_valid;
        struct ceph_msg *req;
index 8a15fe76dafb871701bf0d8e3d7f03898984413f..e7d90c51c881ec5cbea3cefe4642cb5269842d83 100644 (file)
@@ -1071,7 +1071,7 @@ void send_cap_ack(struct ceph_mds_client *mdsc, __u64 ino, int caps, int wanted,
 void ceph_mdsc_handle_filecaps(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
 {
        struct super_block *sb = mdsc->client->sb;
-       struct ceph_client *client = sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(sb);
        struct ceph_mds_session *session;
        struct inode *inode;
        struct ceph_mds_file_caps *h;
index 3ba2db095837be4b8f1510e7cf463ea6b4c82372..86f9d2d346a158c3527ffb0c34b1e480101ad4d5 100644 (file)
@@ -71,7 +71,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
  */
 static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt)
 {
-       struct ceph_client *client = mnt->mnt_sb->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(mnt->mnt_sb);
        struct ceph_mount_args *args = &client->mount_args;
 
        if (ceph_debug != 0)
@@ -377,7 +377,7 @@ bail:
 static int ceph_compare_super(struct super_block *sb, void *data)
 {
        struct ceph_mount_args *args = (struct ceph_mount_args*)data;
-       struct ceph_client *other = sb->s_fs_info;
+       struct ceph_client *other = ceph_sb_to_client(sb);
        int i;
        dout(10, "ceph_compare_super %p\n", sb);
 
@@ -431,7 +431,7 @@ static int ceph_get_sb(struct file_system_type *fs_type,
                err = PTR_ERR(sb);
                goto out;
        }
-       client = sb->s_fs_info;
+       client = ceph_sb_to_client(sb);
 
        if ((err = ceph_mount(client, &mount_args, &droot)) < 0)
                goto out_splat;
@@ -454,7 +454,7 @@ out:
 
 static void ceph_kill_sb(struct super_block *s)
 {
-       struct ceph_client *client = s->s_fs_info;
+       struct ceph_client *client = ceph_sb_to_client(s);
        dout(1, "kill_sb %p\n", s);
        ceph_destroy_client(client);
        kill_anon_super(s);
index 5db9497baa5633253f1b321ed4b7b8cde4efe045..e1406c638c88d77698794b3aa5ea1bf13f2bd11d 100644 (file)
@@ -180,6 +180,10 @@ static inline struct ceph_client *ceph_inode_to_client(struct inode *inode)
        return (struct ceph_client*)inode->i_sb->s_fs_info;
 }
 
+static inline struct ceph_client *ceph_sb_to_client(struct super_block *sb)
+{
+       return (struct ceph_client*)sb->s_fs_info;
+}
 /*
  * keep readdir buffers attached to file->private_data
  */