Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131767
b: refs/heads/master
c: 0af80c0
h: refs/heads/master
i:
  131765: 2c83ae5
  131763: f14fee3
  131759: c985c5b
v: v3
  • Loading branch information
David Fries authored and Bartlomiej Zolnierkiewicz committed Feb 25, 2009
1 parent d2a56c3 commit 3b1aaba
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 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: 0b0a0806b0d8635e046bf533225a25903b1cddce
refs/heads/master: 0af80c04e2f2e45ae09fceb17df8050f828a5c40
6 changes: 4 additions & 2 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,10 @@ and is between 256 and 4096 characters. It is defined in the file
icn= [HW,ISDN]
Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]

ide= [HW] (E)IDE subsystem
Format: ide=nodma or ide=doubler
ide-core.nodma= [HW] (E)IDE subsystem
Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
.chs .ignore_cable are additional options
See Documentation/ide/ide.txt.

idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ menuconfig IDE
SMART parameters from disk drives.

To compile this driver as a module, choose M here: the
module will be called ide.
module will be called ide-core.ko.

For further information, please read <file:Documentation/ide/ide.txt>.

Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
int a, b, i, j = 1;
unsigned int *dev_param_mask = (unsigned int *)kp->arg;

/* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
sscanf(s, "%d.%d", &a, &b) != 2)
return -EINVAL;
Expand All @@ -349,7 +350,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
if (j)
*dev_param_mask |= (1 << i);
else
*dev_param_mask &= (1 << i);
*dev_param_mask &= ~(1 << i);

return 0;
}
Expand Down Expand Up @@ -392,6 +393,8 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
{
int a, b, c = 0, h = 0, s = 0, i, j = 1;

/* controller . device (0 or 1) : Cylinders , Heads , Sectors */
/* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
return -EINVAL;
Expand All @@ -407,7 +410,7 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
if (j)
ide_disks |= (1 << i);
else
ide_disks &= (1 << i);
ide_disks &= ~(1 << i);

ide_disks_chs[i].cyl = c;
ide_disks_chs[i].head = h;
Expand Down Expand Up @@ -469,6 +472,8 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
{
int i, j = 1;

/* controller (ignore) */
/* controller : 1 (ignore) | 0 (use) */
if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1)
return -EINVAL;

Expand All @@ -478,7 +483,7 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
if (j)
ide_ignore_cable |= (1 << i);
else
ide_ignore_cable &= (1 << i);
ide_ignore_cable &= ~(1 << i);

return 0;
}
Expand Down
43 changes: 22 additions & 21 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ static inline struct shmem_sb_info *SHMEM_SB(struct super_block *sb)
*/
static inline int shmem_acct_size(unsigned long flags, loff_t size)
{
return (flags & VM_NORESERVE) ?
0 : security_vm_enough_memory_kern(VM_ACCT(size));
return (flags & VM_ACCOUNT) ?
security_vm_enough_memory_kern(VM_ACCT(size)) : 0;
}

static inline void shmem_unacct_size(unsigned long flags, loff_t size)
{
if (!(flags & VM_NORESERVE))
if (flags & VM_ACCOUNT)
vm_unacct_memory(VM_ACCT(size));
}

Expand All @@ -187,13 +187,13 @@ static inline void shmem_unacct_size(unsigned long flags, loff_t size)
*/
static inline int shmem_acct_block(unsigned long flags)
{
return (flags & VM_NORESERVE) ?
security_vm_enough_memory_kern(VM_ACCT(PAGE_CACHE_SIZE)) : 0;
return (flags & VM_ACCOUNT) ?
0 : security_vm_enough_memory_kern(VM_ACCT(PAGE_CACHE_SIZE));
}

static inline void shmem_unacct_blocks(unsigned long flags, long pages)
{
if (flags & VM_NORESERVE)
if (!(flags & VM_ACCOUNT))
vm_unacct_memory(pages * VM_ACCT(PAGE_CACHE_SIZE));
}

Expand Down Expand Up @@ -1515,8 +1515,8 @@ static int shmem_mmap(struct file *file, struct vm_area_struct *vma)
return 0;
}

static struct inode *shmem_get_inode(struct super_block *sb, int mode,
dev_t dev, unsigned long flags)
static struct inode *
shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
{
struct inode *inode;
struct shmem_inode_info *info;
Expand All @@ -1537,7 +1537,6 @@ static struct inode *shmem_get_inode(struct super_block *sb, int mode,
info = SHMEM_I(inode);
memset(info, 0, (char *)inode - (char *)info);
spin_lock_init(&info->lock);
info->flags = flags & VM_NORESERVE;
INIT_LIST_HEAD(&info->swaplist);

switch (mode & S_IFMT) {
Expand Down Expand Up @@ -1780,10 +1779,9 @@ static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf)
static int
shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
{
struct inode *inode;
struct inode *inode = shmem_get_inode(dir->i_sb, mode, dev);
int error = -ENOSPC;

inode = shmem_get_inode(dir->i_sb, mode, dev, VM_NORESERVE);
if (inode) {
error = security_inode_init_security(inode, dir, NULL, NULL,
NULL);
Expand Down Expand Up @@ -1922,7 +1920,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
if (len > PAGE_CACHE_SIZE)
return -ENAMETOOLONG;

inode = shmem_get_inode(dir->i_sb, S_IFLNK|S_IRWXUGO, 0, VM_NORESERVE);
inode = shmem_get_inode(dir->i_sb, S_IFLNK|S_IRWXUGO, 0);
if (!inode)
return -ENOSPC;

Expand Down Expand Up @@ -2334,7 +2332,7 @@ static int shmem_fill_super(struct super_block *sb,
sb->s_flags |= MS_POSIXACL;
#endif

inode = shmem_get_inode(sb, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE);
inode = shmem_get_inode(sb, S_IFDIR | sbinfo->mode, 0);
if (!inode)
goto failed;
inode->i_uid = sbinfo->uid;
Expand Down Expand Up @@ -2576,12 +2574,12 @@ int shmem_unuse(swp_entry_t entry, struct page *page)
return 0;
}

#define shmem_vm_ops generic_file_vm_ops
#define shmem_file_operations ramfs_file_operations
#define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev)
#define shmem_acct_size(flags, size) 0
#define shmem_unacct_size(flags, size) do {} while (0)
#define SHMEM_MAX_BYTES LLONG_MAX
#define shmem_file_operations ramfs_file_operations
#define shmem_vm_ops generic_file_vm_ops
#define shmem_get_inode ramfs_get_inode
#define shmem_acct_size(a, b) 0
#define shmem_unacct_size(a, b) do {} while (0)
#define SHMEM_MAX_BYTES LLONG_MAX

#endif /* CONFIG_SHMEM */

Expand All @@ -2591,7 +2589,7 @@ int shmem_unuse(swp_entry_t entry, struct page *page)
* shmem_file_setup - get an unlinked file living in tmpfs
* @name: name for dentry (to be seen in /proc/<pid>/maps
* @size: size to be set for the file
* @flags: VM_NORESERVE suppresses pre-accounting of the entire object size
* @flags: vm_flags
*/
struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
{
Expand Down Expand Up @@ -2625,10 +2623,13 @@ struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
goto put_dentry;

error = -ENOSPC;
inode = shmem_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0, flags);
inode = shmem_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0);
if (!inode)
goto close_file;

#ifdef CONFIG_SHMEM
SHMEM_I(inode)->flags = (flags & VM_NORESERVE) ? 0 : VM_ACCOUNT;
#endif
d_instantiate(dentry, inode);
inode->i_size = size;
inode->i_nlink = 0; /* It is unlinked */
Expand Down

0 comments on commit 3b1aaba

Please sign in to comment.