diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index a45b55dfeb0d5146968e5e8599688d3cbae10b92..decc2fdbffafa21d00a56414d6534345fc04423b 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -197,6 +197,8 @@ static read_proc_t ntlmv2_enabled_read; static write_proc_t ntlmv2_enabled_write; static read_proc_t packet_signing_enabled_read; static write_proc_t packet_signing_enabled_write; +static read_proc_t quotaEnabled_read; +static write_proc_t quotaEnabled_write; void cifs_proc_init(void) @@ -233,6 +235,11 @@ cifs_proc_init(void) if (pde) pde->write_proc = oplockEnabled_write; + pde = create_proc_read_entry("QuotaEnabled", 0, proc_fs_cifs, + quotaEnabled_read, 0); + if (pde) + pde->write_proc = quotaEnabled_write; + pde = create_proc_read_entry("MultiuserMount", 0, proc_fs_cifs, multiuser_mount_read, 0); @@ -361,6 +368,47 @@ oplockEnabled_write(struct file *file, const char *buffer, return count; } +static int +quotaEnabled_read(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + + len = sprintf(page, "%d\n", quotaEnabled); +/* could also check if quotas are enabled in kernel + as a whole first */ + len -= off; + *start = page + off; + + if (len > count) + len = count; + else + *eof = 1; + + if (len < 0) + len = 0; + + return len; +} +static int +quotaEnabled_write(struct file *file, const char *buffer, + unsigned long count, void *data) +{ + char c; + int rc; + + rc = get_user(c, buffer); + if (rc) + return rc; + if (c == '0' || c == 'n' || c == 'N') + quotaEnabled = 0; + else if (c == '1' || c == 'y' || c == 'Y') + quotaEnabled = 1; + + return count; +} + + static int lookupFlag_read(char *page, char **start, off_t off, int count, int *eof, void *data) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 6f35447558ea4073f87d431721edd98ee9f20fd5..f600f27df21f543150775b6d9041ff22e4840c9f 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -42,12 +42,17 @@ #include <linux/mm.h> #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of all SMB PDUs */ +#ifdef CIFS_QUOTA +static struct quotactl_ops cifs_quotactl_ops; +#endif + extern struct file_system_type cifs_fs_type; int cifsFYI = 0; int cifsERROR = 1; int traceSMB = 0; unsigned int oplockEnabled = 1; +unsigned int quotaEnabled = 0; unsigned int lookupCacheEnabled = 1; unsigned int multiuser_mount = 0; unsigned int extended_security = 0; @@ -92,7 +97,9 @@ cifs_read_super(struct super_block *sb, void *data, sb->s_op = &cifs_super_ops; /* if(cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512) sb->s_blocksize = cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */ - +#ifdef CIFS_QUOTA + sb->s_qcop = &cifs_quotactl_ops; +#endif sb->s_blocksize = CIFS_MAX_MSGSIZE; sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ inode = iget(sb, ROOT_I); @@ -247,6 +254,7 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) return 0; } +#ifdef CIFS_QUOTA int cifs_xquota_set(struct super_block * sb, int quota_type, qid_t qid, struct fs_disk_quota * pdquota) { @@ -262,10 +270,10 @@ int cifs_xquota_set(struct super_block * sb, int quota_type, qid_t qid, xid = GetXid(); - if(pTcon) - rc = -EIO; - else { - + if(pTcon) { + cFYI(1,("set type: 0x%x id: %d",quota_type,qid)); + } else { + return -EIO; } FreeXid(xid); @@ -286,10 +294,10 @@ int cifs_xquota_get(struct super_block * sb, int quota_type, qid_t qid, return -EIO; xid = GetXid(); - if(pTcon) + if(pTcon) { + cFYI(1,("set type: 0x%x id: %d",quota_type,qid)); + } else { rc = -EIO; - else { - } FreeXid(xid); @@ -309,10 +317,10 @@ int cifs_xstate_set(struct super_block * sb, unsigned int flags, int operation) return -EIO; xid = GetXid(); - if(pTcon) + if(pTcon) { + cFYI(1,("flags: 0x%x operation: 0x%x",flags,operation)); + } else { rc = -EIO; - else { - } FreeXid(xid); @@ -326,16 +334,16 @@ int cifs_xstate_get(struct super_block * sb, struct fs_quota_stat *qstats) struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifsTconInfo *pTcon; - if(cifs_sb) + if(cifs_sb) { pTcon = cifs_sb->tcon; - else + } else { return -EIO; - + } xid = GetXid(); - if(pTcon) + if(pTcon) { + cFYI(1,("pqstats %p",qstats)); + } else { rc = -EIO; - else { - } FreeXid(xid); @@ -348,6 +356,7 @@ static struct quotactl_ops cifs_quotactl_ops = { .set_xstate = cifs_xstate_set, .get_xstate = cifs_xstate_get, }; +#endif struct super_operations cifs_super_ops = { .read_inode = cifs_read_inode, diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 64289691f60c170a0fedd9d0d5501294334d1498..1ff8862d39e923d83ae89304577995ecc070db86 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -347,6 +347,7 @@ GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions have the uid/password or Kerberos credential or equivalent for current user */ GLOBAL_EXTERN unsigned int oplockEnabled; +GLOBAL_EXTERN unsigned int quotaEnabled; GLOBAL_EXTERN unsigned int lookupCacheEnabled; GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent with more secure ntlmssp2 challenge/resp */ diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 05f947bbe5a1bd270a05a71ea2ce0685b5516a3d..0b8bb170f7aaccaf3e56acc4a1321bbb418442f7 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1114,9 +1114,6 @@ construct_dentry(struct qstr *qstring, struct file *file, } tmp_dentry->d_time = jiffies; - (*ptmp_inode)->i_blksize = - (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00; - cFYI(1, ("i_blksize = %ld", (*ptmp_inode)->i_blksize)); *pnew_dentry = tmp_dentry; }