オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.6.x/ccs-patch/fs/realpath.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1015 by kumaneko, Tue Mar 4 04:04:39 2008 UTC revision 1016 by kumaneko, Tue Mar 4 05:51:18 2008 UTC
# Line 81  static int GetAbsolutePath(struct dentry Line 81  static int GetAbsolutePath(struct dentry
81                          continue;                          continue;
82                  }                  }
83                  if (is_dir) {                  if (is_dir) {
84                          is_dir = 0; *--end = '/'; buflen--;                          is_dir = false; *--end = '/'; buflen--;
85                  }                  }
86                  parent = dentry->d_parent;                  parent = dentry->d_parent;
87                  {                  {
# Line 251  void *alloc_element(const unsigned int s Line 251  void *alloc_element(const unsigned int s
251          if (word_aligned_size > PAGE_SIZE) return NULL;          if (word_aligned_size > PAGE_SIZE) return NULL;
252          mutex_lock(&lock);          mutex_lock(&lock);
253          if (buf_used_len + word_aligned_size > PAGE_SIZE) {          if (buf_used_len + word_aligned_size > PAGE_SIZE) {
254                  if ((ptr = kmalloc(PAGE_SIZE, GFP_KERNEL)) == NULL) {                  if ((ptr = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL) {
255                          printk("ERROR: Out of memory for alloc_element().\n");                          printk("ERROR: Out of memory for alloc_element().\n");
256                          if (!sbin_init_started) panic("MAC Initialization failed.\n");                          if (!sbin_init_started) panic("MAC Initialization failed.\n");
257                  } else {                  } else {
                         memset(ptr, 0, PAGE_SIZE);  
258                          buf = ptr;                          buf = ptr;
259                          allocated_memory_for_elements += PAGE_SIZE;                          allocated_memory_for_elements += PAGE_SIZE;
260                          buf_used_len = word_aligned_size;                          buf_used_len = word_aligned_size;
# Line 324  const struct path_info *SaveName(const c Line 323  const struct path_info *SaveName(const c
323          list_for_each_entry(fmb, &fmb_list, list) {          list_for_each_entry(fmb, &fmb_list, list) {
324                  if (len <= fmb->len) goto ready;                  if (len <= fmb->len) goto ready;
325          }          }
326          cp = kmalloc(PAGE_SIZE, GFP_KERNEL);          cp = kzalloc(PAGE_SIZE, GFP_KERNEL);
327          fmb = kmalloc(sizeof(*fmb), GFP_KERNEL);          fmb = kzalloc(sizeof(*fmb), GFP_KERNEL);
328          if (!cp || !fmb) {          if (!cp || !fmb) {
329                  kfree(cp);                  kfree(cp);
330                  kfree(fmb);                  kfree(fmb);
# Line 334  const struct path_info *SaveName(const c Line 333  const struct path_info *SaveName(const c
333                  ptr = NULL;                  ptr = NULL;
334                  goto out;                  goto out;
335          }          }
         memset(cp, 0, PAGE_SIZE);  
336          allocated_memory_for_savename += PAGE_SIZE;          allocated_memory_for_savename += PAGE_SIZE;
337          list_add(&fmb->list, &fmb_list);          list_add(&fmb->list, &fmb_list);
338          fmb->ptr = cp;          fmb->ptr = cp;
# Line 414  static int round2(size_t size) Line 412  static int round2(size_t size)
412    
413  void *ccs_alloc(const size_t size)  void *ccs_alloc(const size_t size)
414  {  {
415          void *ret = kmalloc(size, GFP_KERNEL);          void *ret = kzalloc(size, GFP_KERNEL);
416          if (ret) {          if (ret) {
417                  struct cache_entry *new_entry = kmem_cache_alloc(ccs_cachep, GFP_KERNEL);                  struct cache_entry *new_entry = kmem_cache_alloc(ccs_cachep, GFP_KERNEL);
418                  if (!new_entry) {                  if (!new_entry) {
# Line 431  void *ccs_alloc(const size_t size) Line 429  void *ccs_alloc(const size_t size)
429                          list_add_tail(&new_entry->list, &cache_list);                          list_add_tail(&new_entry->list, &cache_list);
430                          dynamic_memory_size += new_entry->size;                          dynamic_memory_size += new_entry->size;
431                          spin_unlock(&cache_list_lock);                          spin_unlock(&cache_list_lock);
                         memset(ret, 0, size);  
432                  }                  }
433          }          }
434          return ret;          return ret;

Legend:
Removed from v.1015  
changed lines
  Added in v.1016

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26