]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: audit inline
authorSage Weil <sage@newdream.net>
Wed, 30 Sep 2009 18:32:03 +0000 (11:32 -0700)
committerSage Weil <sage@newdream.net>
Wed, 30 Sep 2009 18:32:03 +0000 (11:32 -0700)
src/kernel/caps.c
src/kernel/dir.c
src/kernel/inode.c
src/kernel/messenger.c
src/kernel/messenger.h
src/kernel/super.h

index edf36cdfac483974f22a10a36c6e5ee37cc70e13..f5af1a4098ac9dd916e7c7b92d332dbf0f770fad 100644 (file)
@@ -791,6 +791,35 @@ int ceph_caps_revoking(struct ceph_inode_info *ci, int mask)
        return ret;
 }
 
+int __ceph_caps_used(struct ceph_inode_info *ci)
+{
+       int used = 0;
+       if (ci->i_pin_ref)
+               used |= CEPH_CAP_PIN;
+       if (ci->i_rd_ref)
+               used |= CEPH_CAP_FILE_RD;
+       if (ci->i_rdcache_ref || ci->i_rdcache_gen)
+               used |= CEPH_CAP_FILE_CACHE;
+       if (ci->i_wr_ref)
+               used |= CEPH_CAP_FILE_WR;
+       if (ci->i_wrbuffer_ref)
+               used |= CEPH_CAP_FILE_BUFFER;
+       return used;
+}
+
+/*
+ * wanted, by virtue of open file modes
+ */
+int __ceph_caps_file_wanted(struct ceph_inode_info *ci)
+{
+       int want = 0;
+       int mode;
+       for (mode = 0; mode < 4; mode++)
+               if (ci->i_nr_by_mode[mode])
+                       want |= ceph_caps_for_mode(mode);
+       return want;
+}
+
 /*
  * Return caps we have registered with the MDS(s) as 'wanted'.
  */
index 5307263f6190b42eaf46e70eae2a3f43e707306f..7bb8db524e587012b407e679288836ea1d70cb8f 100644 (file)
@@ -28,6 +28,42 @@ const struct inode_operations ceph_dir_iops;
 const struct file_operations ceph_dir_fops;
 struct dentry_operations ceph_dentry_ops;
 
+/*
+ * Initialize ceph dentry state.
+ */
+int ceph_init_dentry(struct dentry *dentry)
+{
+       struct ceph_dentry_info *di;
+
+       if (dentry->d_fsdata)
+               return 0;
+
+       if (ceph_snap(dentry->d_parent->d_inode) == CEPH_NOSNAP)
+               dentry->d_op = &ceph_dentry_ops;
+       else if (ceph_snap(dentry->d_parent->d_inode) == CEPH_SNAPDIR)
+               dentry->d_op = &ceph_snapdir_dentry_ops;
+       else
+               dentry->d_op = &ceph_snap_dentry_ops;
+
+       di = kmem_cache_alloc(ceph_dentry_cachep, GFP_NOFS);
+       if (!di)
+               return -ENOMEM;          /* oh well */
+
+       spin_lock(&dentry->d_lock);
+       if (dentry->d_fsdata) /* lost a race */
+               goto out_unlock;
+       di->dentry = dentry;
+       di->lease_session = NULL;
+       dentry->d_fsdata = di;
+       dentry->d_time = jiffies;
+       ceph_dentry_lru_add(dentry);
+out_unlock:
+       spin_unlock(&dentry->d_lock);
+       return 0;
+}
+
+
+
 /*
  * for readdir, we encode the directory frag and offset within that
  * frag into f_pos.
index c7402f0f9747ca422e2308a7bcdb210d1255b65c..aa5763d639dbfb0eacc67b16d43b839888a43420 100644 (file)
@@ -721,32 +721,6 @@ out:
        return err;
 }
 
-/*
- * Initialize ceph dentry state.
- */
-int ceph_init_dentry_private(struct dentry *dentry)
-{
-       struct ceph_dentry_info *di;
-
-       if (dentry->d_fsdata)
-               return 0;
-       di = kmem_cache_alloc(ceph_dentry_cachep, GFP_NOFS);
-       if (!di)
-               return -ENOMEM;          /* oh well */
-
-       spin_lock(&dentry->d_lock);
-       if (dentry->d_fsdata) /* lost a race */
-               goto out_unlock;
-       di->dentry = dentry;
-       di->lease_session = NULL;
-       dentry->d_fsdata = di;
-       dentry->d_time = jiffies;
-       ceph_dentry_lru_add(dentry);
-out_unlock:
-       spin_unlock(&dentry->d_lock);
-       return 0;
-}
-
 /*
  * caller should hold session s_mutex.
  */
index 77cf30000f13bcdbc4f9ca6e527c14840cc52170..52e75b88ca073ae6f87c2039a06cdfc9ba9808ef 100644 (file)
@@ -31,6 +31,17 @@ static void queue_con(struct ceph_connection *con);
 static void con_work(struct work_struct *);
 static void ceph_fault(struct ceph_connection *con);
 
+const char *ceph_name_type_str(int t)
+{
+       switch (t) {
+       case CEPH_ENTITY_TYPE_MON: return "mon";
+       case CEPH_ENTITY_TYPE_MDS: return "mds";
+       case CEPH_ENTITY_TYPE_OSD: return "osd";
+       case CEPH_ENTITY_TYPE_CLIENT: return "client";
+       case CEPH_ENTITY_TYPE_ADMIN: return "admin";
+       default: return "???";
+       }
+}
 
 /*
  * work queue for all reading and writing to/from the socket.
index 55cd4376f30169ca40d72237e5609ec7630018f4..f853908b2d2a8f70f560b67da624b3f4fbd449b5 100644 (file)
@@ -54,17 +54,7 @@ struct ceph_connection_operations {
                              int want);
 };
 
-static inline const char *ceph_name_type_str(int t)
-{
-       switch (t) {
-       case CEPH_ENTITY_TYPE_MON: return "mon";
-       case CEPH_ENTITY_TYPE_MDS: return "mds";
-       case CEPH_ENTITY_TYPE_OSD: return "osd";
-       case CEPH_ENTITY_TYPE_CLIENT: return "client";
-       case CEPH_ENTITY_TYPE_ADMIN: return "admin";
-       default: return "???";
-       }
-}
+extern const char *ceph_name_type_str(int t);
 
 /* use format string %s%d */
 #define ENTITY_NAME(n) ceph_name_type_str((n).type), le64_to_cpu((n).num)
index 669a9a4748fe658683ab8a8fa73bb776b10ac0b5..7fa9f0b823947f4d458be596eea2b0b27d9c8dd2 100644 (file)
@@ -528,35 +528,9 @@ static inline int __ceph_caps_dirty(struct ceph_inode_info *ci)
 extern int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask);
 
 extern int ceph_caps_revoking(struct ceph_inode_info *ci, int mask);
+extern int __ceph_caps_used(struct ceph_inode_info *ci);
 
-static inline int __ceph_caps_used(struct ceph_inode_info *ci)
-{
-       int used = 0;
-       if (ci->i_pin_ref)
-               used |= CEPH_CAP_PIN;
-       if (ci->i_rd_ref)
-               used |= CEPH_CAP_FILE_RD;
-       if (ci->i_rdcache_ref || ci->i_rdcache_gen)
-               used |= CEPH_CAP_FILE_CACHE;
-       if (ci->i_wr_ref)
-               used |= CEPH_CAP_FILE_WR;
-       if (ci->i_wrbuffer_ref)
-               used |= CEPH_CAP_FILE_BUFFER;
-       return used;
-}
-
-/*
- * wanted, by virtue of open file modes
- */
-static inline int __ceph_caps_file_wanted(struct ceph_inode_info *ci)
-{
-       int want = 0;
-       int mode;
-       for (mode = 0; mode < 4; mode++)
-               if (ci->i_nr_by_mode[mode])
-                       want |= ceph_caps_for_mode(mode);
-       return want;
-}
+extern int __ceph_caps_file_wanted(struct ceph_inode_info *ci);
 
 /*
  * wanted, by virtue of open file modes AND cap refs (buffered/cached data)
@@ -892,23 +866,8 @@ extern void ceph_dentry_lru_del(struct dentry *dn);
  * our d_ops vary depending on whether the inode is live,
  * snapshotted (read-only), or a virtual ".snap" directory.
  */
-int ceph_init_dentry_private(struct dentry *dentry);
-
-static inline int ceph_init_dentry(struct dentry *dentry)
-{
-       int ret;
+int ceph_init_dentry(struct dentry *dentry);
 
-       if (ceph_snap(dentry->d_parent->d_inode) == CEPH_NOSNAP)
-               dentry->d_op = &ceph_dentry_ops;
-       else if (ceph_snap(dentry->d_parent->d_inode) == CEPH_SNAPDIR)
-               dentry->d_op = &ceph_snapdir_dentry_ops;
-       else
-               dentry->d_op = &ceph_snap_dentry_ops;
-
-       ret = ceph_init_dentry_private(dentry);
-
-       return ret;
-}
 
 /* ioctl.c */
 extern long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg);