Whamcloud - gitweb
LU-946 lprocfs: List open files in filesystem
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status.c
index 9b39be3..1012ab9 100644 (file)
@@ -291,7 +291,7 @@ int lprocfs_evict_client_open(struct inode *inode, struct file *f)
         struct proc_dir_entry *dp = PDE(f->f_dentry->d_inode);
         struct obd_device *obd = dp->data;
 
-        cfs_atomic_inc(&obd->obd_evict_inprogress);
+       atomic_inc(&obd->obd_evict_inprogress);
 
         return 0;
 }
@@ -301,7 +301,7 @@ int lprocfs_evict_client_release(struct inode *inode, struct file *f)
        struct proc_dir_entry *dp = PDE(f->f_dentry->d_inode);
        struct obd_device *obd = dp->data;
 
-       cfs_atomic_dec(&obd->obd_evict_inprogress);
+       atomic_dec(&obd->obd_evict_inprogress);
        wake_up(&obd->obd_evict_inprogress_waitq);
 
        return 0;
@@ -652,7 +652,7 @@ EXPORT_SYMBOL(lprocfs_u64_seq_show);
 
 int lprocfs_atomic_seq_show(struct seq_file *m, void *data)
 {
-       cfs_atomic_t *atom = data;
+       atomic_t *atom = data;
        LASSERT(atom != NULL);
        return seq_printf(m, "%d\n", atomic_read(atom));
 }
@@ -662,7 +662,7 @@ ssize_t
 lprocfs_atomic_seq_write(struct file *file, const char *buffer,
                        size_t count, loff_t *off)
 {
-       cfs_atomic_t *atm = ((struct seq_file *)file->private_data)->private;
+       atomic_t *atm = ((struct seq_file *)file->private_data)->private;
        int val = 0;
        int rc;
 
@@ -673,7 +673,7 @@ lprocfs_atomic_seq_write(struct file *file, const char *buffer,
        if (val <= 0)
                return -ERANGE;
 
-       cfs_atomic_set(atm, val);
+       atomic_set(atm, val);
        return count;
 }
 EXPORT_SYMBOL(lprocfs_atomic_seq_write);
@@ -1301,17 +1301,17 @@ EXPORT_SYMBOL(lprocfs_rd_u64);
 int lprocfs_rd_atomic(char *page, char **start, off_t off,
                    int count, int *eof, void *data)
 {
-        cfs_atomic_t *atom = data;
+       atomic_t *atom = data;
         LASSERT(atom != NULL);
         *eof = 1;
-        return snprintf(page, count, "%d\n", cfs_atomic_read(atom));
+       return snprintf(page, count, "%d\n", atomic_read(atom));
 }
 EXPORT_SYMBOL(lprocfs_rd_atomic);
 
 int lprocfs_wr_atomic(struct file *file, const char *buffer,
                       unsigned long count, void *data)
 {
-        cfs_atomic_t *atm = data;
+       atomic_t *atm = data;
         int val = 0;
         int rc;
 
@@ -1322,7 +1322,7 @@ int lprocfs_wr_atomic(struct file *file, const char *buffer,
         if (val <= 0)
                 return -ERANGE;
 
-        cfs_atomic_set(atm, val);
+       atomic_set(atm, val);
         return count;
 }
 EXPORT_SYMBOL(lprocfs_wr_atomic);
@@ -1589,7 +1589,7 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count,
                              libcfs_nid2str(imp->imp_connection->c_peer.nid),
                      imp->imp_conn_cnt,
                      imp->imp_generation,
-                     cfs_atomic_read(&imp->imp_inval_count));
+                     atomic_read(&imp->imp_inval_count));
        spin_unlock(&imp->imp_lock);
 
        if (obd->obd_svc_stats == NULL)
@@ -1610,9 +1610,9 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count,
                       "       unregistering: %u\n"
                       "       timeouts: %u\n"
                       "       avg_waittime: "LPU64" %s\n",
-                      cfs_atomic_read(&imp->imp_inflight),
-                      cfs_atomic_read(&imp->imp_unregistering),
-                      cfs_atomic_read(&imp->imp_timeouts),
+                     atomic_read(&imp->imp_inflight),
+                     atomic_read(&imp->imp_unregistering),
+                     atomic_read(&imp->imp_timeouts),
                      ret.lc_sum, header->lc_units);
 
         k = 0;
@@ -1881,7 +1881,7 @@ static void lprocfs_free_client_stats(struct nid_stat *client_stat)
        CDEBUG(D_CONFIG, "stat %p - data %p/%p\n", client_stat,
               client_stat->nid_proc, client_stat->nid_stats);
 
-        LASSERTF(cfs_atomic_read(&client_stat->nid_exp_ref_count) == 0,
+       LASSERTF(atomic_read(&client_stat->nid_exp_ref_count) == 0,
                  "nid %s:count %d\n", libcfs_nid2str(client_stat->nid),
                  atomic_read(&client_stat->nid_exp_ref_count));
 
@@ -2382,6 +2382,7 @@ void lprocfs_init_mps_stats(int num_private_stats, struct lprocfs_stats *stats)
         LPROCFS_MD_OP_INIT(num_private_stats, stats, setattr);
        LPROCFS_MD_OP_INIT(num_private_stats, stats, fsync);
         LPROCFS_MD_OP_INIT(num_private_stats, stats, readpage);
+       LPROCFS_MD_OP_INIT(num_private_stats, stats, read_entry);
         LPROCFS_MD_OP_INIT(num_private_stats, stats, unlink);
         LPROCFS_MD_OP_INIT(num_private_stats, stats, setxattr);
         LPROCFS_MD_OP_INIT(num_private_stats, stats, getxattr);
@@ -2497,10 +2498,10 @@ int lprocfs_exp_rd_nid(char *page, char **start, off_t off, int count,
 }
 
 struct exp_uuid_cb_data {
-        char                   *page;
-        int                     count;
-        int                    *eof;
-        int                    *len;
+       char                   *page;
+       int                     count;
+       int                    *eof;
+       int                    *len;
 };
 
 static void
@@ -2594,8 +2595,8 @@ static int lprocfs_nid_stats_clear_write_cb(void *obj, void *data)
         struct nid_stat *stat = obj;
         ENTRY;
 
-        CDEBUG(D_INFO,"refcnt %d\n", cfs_atomic_read(&stat->nid_exp_ref_count));
-        if (cfs_atomic_read(&stat->nid_exp_ref_count) == 1) {
+       CDEBUG(D_INFO,"refcnt %d\n", atomic_read(&stat->nid_exp_ref_count));
+       if (atomic_read(&stat->nid_exp_ref_count) == 1) {
                 /* object has only hash references. */
                spin_lock(&stat->nid_obd->obd_nid_lock);
                cfs_list_move(&stat->nid_list, data);
@@ -2670,13 +2671,13 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
         new_stat->nid               = *nid;
         new_stat->nid_obd           = exp->exp_obd;
         /* we need set default refcount to 1 to balance obd_disconnect */
-        cfs_atomic_set(&new_stat->nid_exp_ref_count, 1);
+       atomic_set(&new_stat->nid_exp_ref_count, 1);
 
         old_stat = cfs_hash_findadd_unique(obd->obd_nid_stats_hash,
                                            nid, &new_stat->nid_hash);
         CDEBUG(D_INFO, "Found stats %p for nid %s - ref %d\n",
                old_stat, libcfs_nid2str(*nid),
-               cfs_atomic_read(&new_stat->nid_exp_ref_count));
+              atomic_read(&new_stat->nid_exp_ref_count));
 
        /* Return -EALREADY here so that we know that the /proc
         * entry already has been created */
@@ -3224,21 +3225,21 @@ int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
                                  cfs_time_current_sec()) <= 0)
                 goto out;
         if (lprocfs_obd_snprintf(&page, size, &len,"connected_clients: %d/%d\n",
-                                 cfs_atomic_read(&obd->obd_connected_clients),
+                                atomic_read(&obd->obd_connected_clients),
                                  obd->obd_max_recoverable_clients) <= 0)
                 goto out;
         /* Number of clients that have completed recovery */
         if (lprocfs_obd_snprintf(&page, size, &len,"req_replay_clients: %d\n",
-                                 cfs_atomic_read(&obd->obd_req_replay_clients))
+                                atomic_read(&obd->obd_req_replay_clients))
                 <= 0)
                 goto out;
         if (lprocfs_obd_snprintf(&page, size, &len,"lock_repay_clients: %d\n",
-                                 cfs_atomic_read(&obd->obd_lock_replay_clients))
+                                atomic_read(&obd->obd_lock_replay_clients))
                 <=0)
                 goto out;
         if (lprocfs_obd_snprintf(&page, size, &len,"completed_clients: %d\n",
-                                 cfs_atomic_read(&obd->obd_connected_clients) -
-                                 cfs_atomic_read(&obd->obd_lock_replay_clients))
+                                atomic_read(&obd->obd_connected_clients) -
+                                atomic_read(&obd->obd_lock_replay_clients))
                 <=0)
                 goto out;
         if (lprocfs_obd_snprintf(&page, size, &len,"evicted_clients: %d\n",