Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77303
b: refs/heads/master
c: e6ab158
h: refs/heads/master
i:
  77301: 7f614af
  77299: 9608ec9
  77295: 639d957
v: v3
  • Loading branch information
Igor Mammedov authored and Steve French committed Jan 11, 2008
1 parent 07d476f commit 2ee3d75
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 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: 197c183f3526dc08aa52ca97ec66c268442d4b84
refs/heads/master: e6ab15827eec0bc4444421f7ccf0223de321c708
5 changes: 4 additions & 1 deletion trunk/fs/cifs/cifs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ struct cifs_sb_info {
mode_t mnt_dir_mode;
int mnt_cifs_flags;
int prepathlen;
char *prepath;
char *prepath; /* relative path under the share to mount to */
#ifdef CONFIG_CIFS_DFS_UPCALL
char *mountdata; /* mount options received at mount time */
#endif
};
#endif /* _CIFS_FS_SB_H */
37 changes: 36 additions & 1 deletion trunk/fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ cifs_read_super(struct super_block *sb, void *data,
{
struct inode *inode;
struct cifs_sb_info *cifs_sb;
#ifdef CONFIG_CIFS_DFS_UPCALL
int len;
#endif
int rc = 0;

/* BB should we make this contingent on mount parm? */
Expand All @@ -106,6 +109,25 @@ cifs_read_super(struct super_block *sb, void *data,
if (cifs_sb == NULL)
return -ENOMEM;

#ifdef CONFIG_CIFS_DFS_UPCALL
/* copy mount params to sb for use in submounts */
/* BB: should we move this after the mount so we
* do not have to do the copy on failed mounts?
* BB: May be it is better to do simple copy before
* complex operation (mount), and in case of fail
* just exit instead of doing mount and attempting
* undo it if this copy fails?*/
len = strlen(data);
cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
if (cifs_sb->mountdata == NULL) {
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
return -ENOMEM;
}
strncpy(cifs_sb->mountdata, data, len + 1);
cifs_sb->mountdata[len] = '\0';
#endif

rc = cifs_mount(sb, cifs_sb, data, devname);

if (rc) {
Expand Down Expand Up @@ -155,6 +177,12 @@ cifs_read_super(struct super_block *sb, void *data,

out_mount_failed:
if (cifs_sb) {
#ifdef CONFIG_CIFS_DFS_UPCALL
if (cifs_sb->mountdata) {
kfree(cifs_sb->mountdata);
cifs_sb->mountdata = NULL;
}
#endif
if (cifs_sb->local_nls)
unload_nls(cifs_sb->local_nls);
kfree(cifs_sb);
Expand All @@ -178,6 +206,13 @@ cifs_put_super(struct super_block *sb)
if (rc) {
cERROR(1, ("cifs_umount failed with return code %d", rc));
}
#ifdef CONFIG_CIFS_DFS_UPCALL
if (cifs_sb->mountdata) {
kfree(cifs_sb->mountdata);
cifs_sb->mountdata = NULL;
}
#endif

unload_nls(cifs_sb->local_nls);
kfree(cifs_sb);
return;
Expand Down Expand Up @@ -553,7 +588,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
return remote_llseek(file, offset, origin);
}

static struct file_system_type cifs_fs_type = {
struct file_system_type cifs_fs_type = {
.owner = THIS_MODULE,
.name = "cifs",
.get_sb = cifs_get_sb,
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define TRUE 1
#endif

extern struct file_system_type cifs_fs_type;
extern const struct address_space_operations cifs_addr_ops;
extern const struct address_space_operations cifs_addr_ops_smallbuf;

Expand Down

0 comments on commit 2ee3d75

Please sign in to comment.