#include <linux/lprocfs_status.h>
-int rd_path(char* page, char **start, off_t off, int count, int *eof,
+int rd_path(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
return 0;
}
-int rd_fstype(char* page, char **start, off_t off, int count, int *eof,
+
+int rd_fstype(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
struct super_block *sb = (struct super_block*)data;
-
- len += snprintf(page, count, "%s\n", sb->s_type->name);
+
+ len += snprintf(page, count, "%s\n", sb->s_type->name);
return len;
}
-int rd_blksize(char* page, char **start, off_t off, int count, int *eof,
+
+int rd_blksize(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
struct statfs mystats;
(sb->s_op->statfs)(sb, &mystats);
- len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_bsize));
+ len += snprintf(page, count, "%lu\n", mystats.f_bsize);
return len;
}
-int rd_kbytestotal(char* page, char **start, off_t off, int count, int *eof,
+
+int rd_kbytestotal(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
blk_size = mystats.f_bsize;
blk_size >>= 10;
result = mystats.f_blocks;
-
- while(blk_size >>= 1){
+
+ while(blk_size >>= 1)
result <<= 1;
- }
-
- len += snprintf(page, count, LPU64"\n", result);
+
+ len += snprintf(page, count, LPU64"\n", result);
return len;
-
}
-int rd_kbytesfree(char* page, char **start, off_t off, int count, int *eof,
+int rd_kbytesfree(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
struct super_block *sb = (struct super_block*)data;
- struct statfs mystats;
+ struct statfs mystats;
__u32 blk_size;
__u64 result;
blk_size = mystats.f_bsize;
blk_size >>= 10;
result = mystats.f_bfree;
-
- while(blk_size >>= 1){
+
+ while(blk_size >>= 1)
result <<= 1;
- }
-
- len += snprintf(page, count, LPU64"\n", result);
- return len;
-
+ len += snprintf(page, count, LPU64"\n", result);
+ return len;
}
-int rd_filestotal(char* page, char **start, off_t off, int count, int *eof,
+int rd_filestotal(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
-
int len = 0;
struct super_block *sb = (struct super_block*)data;
- struct statfs mystats;
-
+ struct statfs mystats;
+
(sb->s_op->statfs)(sb, &mystats);
- len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_files));
+ len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_files));
return len;
}
-int rd_filesfree(char* page, char **start, off_t off, int count, int *eof,
+int rd_filesfree(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
-
int len = 0;
struct super_block *sb = (struct super_block*)data;
- struct statfs mystats;
-
+ struct statfs mystats;
+
(sb->s_op->statfs)(sb, &mystats);
- len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_ffree));
+ len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_ffree));
return len;
}
-int rd_filegroups(char* page, char **start, off_t off, int count, int *eof,
+int rd_filegroups(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
return 0;
}
-int rd_uuid(char* page, char **start, off_t off, int count, int *eof,
+int rd_uuid(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
struct super_block *sb = (struct super_block*)data;
struct ll_sb_info *sbi = ll_s2sbi(sb);
- len += snprintf(page, count, "%s\n", sbi->ll_sb_uuid);
- return len;
+
+ len += snprintf(page, count, "%s\n", sbi->ll_sb_uuid);
+
+ return len;
}
-int rd_dev_name(char* page, char **start, off_t off, int count, int *eof,
+int rd_dev_name(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
return len;
}
-int rd_dev_uuid(char* page, char **start, off_t off, int count, int *eof,
+int rd_dev_uuid(char* page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
{0}
};
-/*
+/*
* Proc registration function for Lustre
* file system
*/
struct obd_device* obd;
int err;
-
/* Register this mount instance with LProcFS */
snprintf(mnt_name, MAX_STRING_SIZE, "mount_%s", sbi->ll_sb_uuid);
mnt_name[MAX_STRING_SIZE] = '\0';
}
/* MDC */
obd = class_uuid2obd(mdc);
- snprintf(mnt_name, MAX_STRING_SIZE, "status/%s/common_name",
+ snprintf(mnt_name, MAX_STRING_SIZE, "status/%s/common_name",
obd->obd_type->typ_name);
mnt_name[MAX_STRING_SIZE] = '\0';
memset(d_vars, 0, sizeof(d_vars));
obd = class_uuid2obd(osc);
/* Reuse mnt_name */
- snprintf(mnt_name, MAX_STRING_SIZE,
+ snprintf(mnt_name, MAX_STRING_SIZE,
"status/%s/common_name", obd->obd_type->typ_name);
mnt_name[MAX_STRING_SIZE] = '\0';
memset(d_vars, 0, sizeof(d_vars));
struct inode *inode;
LASSERT(hash != 0);
- inode = iget5_locked(sb, hash, ll_test_inode, ll_read_inode2, lic);
+ inode = iget5_locked(sb, hash, ll_test_inode, ll_read_inode2, lic);
- if (!inode)
- return ERR_PTR(-ENOMEM);
+ if (!inode)
+ return ERR_PTR(-ENOMEM);
- if (inode->i_state & I_NEW) {
-
- unlock_new_inode(inode);
- }
+ if (inode->i_state & I_NEW)
+ unlock_new_inode(inode);
// XXX Coda always fills inodes, should Lustre?
return inode;
* de. If found, return it. If not found, return de. */
struct dentry *ll_find_alias(struct inode *inode, struct dentry *de)
{
- struct list_head *tmp;
+ struct list_head *tmp;
- spin_lock(&dcache_lock);
+ spin_lock(&dcache_lock);
list_for_each(tmp, &inode->i_dentry) {
- struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
+ struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
/* We are called here with 'de' already on the aliases list. */
if (dentry == de) {
list_del_init(&dentry->d_hash);
spin_unlock(&dcache_lock);
d_rehash(dentry);
- atomic_inc(&dentry->d_count);
+ atomic_inc(&dentry->d_count);
iput(inode);
return dentry;
- }
+ }
- spin_unlock(&dcache_lock);
+ spin_unlock(&dcache_lock);
return de;
}