Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186124
b: refs/heads/master
c: 5717144
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Mar 5, 2010
1 parent 3bc05b3 commit 37cfd15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 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: c5a7697da9775f7a0e122fa23180becc311772d1
refs/heads/master: 5717144a01d701614cfdb15f09ed562d720cf3db
19 changes: 18 additions & 1 deletion trunk/fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,8 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
struct super_block *sb)
{
char ext[32];
char tag_name[14];
unsigned int i_nlink;
struct v9fs_session_info *v9ses = sb->s_fs_info;

inode->i_nlink = 1;
Expand All @@ -902,7 +904,22 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
inode->i_uid = stat->n_uid;
inode->i_gid = stat->n_gid;
}

if ((S_ISREG(inode->i_mode)) || (S_ISDIR(inode->i_mode))) {
if (v9fs_proto_dotu(v9ses) && (stat->extension[0] != '\0')) {
/*
* Hadlink support got added later to
* to the .u extension. So there can be
* server out there that doesn't support
* this even with .u extension. So check
* for non NULL stat->extension
*/
strncpy(ext, stat->extension, sizeof(ext));
/* HARDLINKCOUNT %u */
sscanf(ext, "%13s %u", tag_name, &i_nlink);
if (!strncmp(tag_name, "HARDLINKCOUNT", 13))
inode->i_nlink = i_nlink;
}
}
inode->i_mode = p9mode2unixmode(v9ses, stat->mode);
if ((S_ISBLK(inode->i_mode)) || (S_ISCHR(inode->i_mode))) {
char type = 0;
Expand Down

0 comments on commit 37cfd15

Please sign in to comment.