Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143661
b: refs/heads/master
c: f2739de
h: refs/heads/master
i:
  143659: 089c169
v: v3
  • Loading branch information
Evgeniy Polyakov authored and Greg Kroah-Hartman committed Apr 17, 2009
1 parent a185fd8 commit 81818d1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50e4babfb0c36f1665ffcdc9a1826021aedb173f
refs/heads/master: f2739de19176009b14475207d5418cd79e7f0ba3
40 changes: 40 additions & 0 deletions trunk/drivers/staging/pohmelfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,45 @@ static int pohmelfs_root_handshake(struct pohmelfs_sb *psb)
return err;
}

static int pohmelfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
{
struct netfs_state *st;
struct pohmelfs_ctl *ctl;
struct pohmelfs_sb *psb = POHMELFS_SB(mnt->mnt_sb);
struct pohmelfs_config *c;

mutex_lock(&psb->state_lock);

seq_printf(m, "\nidx addr(:port) socket_type protocol active priority permissions\n");

list_for_each_entry(c, &psb->state_list, config_entry) {
st = &c->state;
ctl = &st->ctl;

seq_printf(m, "%u ", ctl->idx);
if (ctl->addr.sa_family == AF_INET) {
struct sockaddr_in *sin = (struct sockaddr_in *)&st->ctl.addr;
//seq_printf(m, "%pi4:%u", &sin->sin_addr.s_addr, ntohs(sin->sin_port));
seq_printf(m, "%u.%u.%u.%u:%u", NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port));
} else if (ctl->addr.sa_family == AF_INET6) {
struct sockaddr_in6 *sin = (struct sockaddr_in6 *)&st->ctl.addr;
seq_printf(m, "%pi6:%u", &sin->sin6_addr, ntohs(sin->sin6_port));
} else {
unsigned int i;
for (i=0; i<ctl->addrlen; ++i)
seq_printf(m, "%02x.", ctl->addr.addr[i]);
}

seq_printf(m, " %u %u %d %u %x\n",
ctl->type, ctl->proto,
st->socket != NULL,
ctl->prio, ctl->perm);
}
mutex_unlock(&psb->state_lock);

return 0;
}

static const struct super_operations pohmelfs_sb_ops = {
.alloc_inode = pohmelfs_alloc_inode,
.destroy_inode = pohmelfs_destroy_inode,
Expand All @@ -1768,6 +1807,7 @@ static const struct super_operations pohmelfs_sb_ops = {
.remount_fs = pohmelfs_remount,
.statfs = pohmelfs_statfs,
.show_options = pohmelfs_show_options,
.show_stats = pohmelfs_show_stats,
};

/*
Expand Down
14 changes: 9 additions & 5 deletions trunk/drivers/staging/pohmelfs/netfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,20 @@ struct pohmelfs_crypto
unsigned char data[0]; /* Algorithm string, key and IV */
};

#define POHMELFS_IO_PERM_READ (1<<0)
#define POHMELFS_IO_PERM_WRITE (1<<1)

/*
* Configuration command used to create table of different remote servers.
*/
struct pohmelfs_ctl
{
unsigned int idx; /* Config index */
unsigned int type; /* Socket type */
unsigned int proto; /* Socket protocol */
unsigned int addrlen; /* Size of the address */
unsigned short unused; /* Align structure by 4 bytes */
__u32 idx; /* Config index */
__u32 type; /* Socket type */
__u32 proto; /* Socket protocol */
__u16 addrlen; /* Size of the address */
__u16 perm; /* IO permission */
__u16 prio; /* IO priority */
struct saddr addr; /* Remote server address */
};

Expand Down

0 comments on commit 81818d1

Please sign in to comment.