source: freewrt/package/mini_fo/patches/102-mutex_change.patch@ db5651c

freewrt_1_0 freewrt_2_0
Last change on this file since db5651c was db5651c, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

merge wbx-target-cleanup to trunk.

  • mk directory for some top level makefiles (build.mk,vars.mk)
  • add a separate configfs partition to all models, 128 kb big
  • add model and platform specific startup files and kernel configs
  • delete target/linux/package, add all addon kernel packages to packages
  • simplify target/linux/brcm-2.4/Makefile, abstraction to mk/ comes later
  • add target/image directory, place where the different images are created
  • default off for all extra packages, be sure that you enable all packages you need to get a dsl-capable router. snapshots will be created by a specific config which contains all needed stuff (iptables, pppoe, pptp, haserl, webif)

git-svn-id: svn://www.freewrt.org/trunk/freewrt@588 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 18.5 KB
  • ChangeLog

    From:  <mk@mary.denx.de>
    Date: Tue, 24 Jan 2006 14:09:21 +0000 (+0100)
    Subject:     Support for new mutex infrastructure
    X-Git-Url: http://www.denx.de/cgi-bin/gitweb.cgi?p=mini_fo.git;a=commitdiff;h=1dcc028729060ea83ea662155634b33ae8e2c493
    
      Support for new mutex infrastructure
      (7892f2f48d165a34b0b8130c8a195dfd807b8cb6)
    ---
    
    a b  
     12006-01-24  Markus Klotzbuecher  <mk@mary.denx.de>
     2
     3        * Add tons of ugly ifdefs to Ed L. Cashin's mutex patch to
     4          retain backwards compatibility.
     5       
     62006-01-24  Ed L. Cashin <ecashin@coraid.com>
     7
     8        * Support for the new mutex infrastructure
     9        (7892f2f48d165a34b0b8130c8a195dfd807b8cb6)
     10
    1112005-10-15  Markus Klotzbuecher  <mk@localhost.localdomain>
    212
    313        * Bugfix for a serious memory leak in mini_fo_follow_link.
  • aux.c

    a b int build_sto_structure(dentry_t *dir, d  
    435435
    436436        /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
    437437        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     438#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     439        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     440#else
    438441        down(&hidden_sto_dir_dentry->d_inode->i_sem);
    439 
     442#endif
    440443        /* lets be safe */
    441444        if(dtohd2(dir) != hidden_sto_dir_dentry) {
    442445                printk(KERN_CRIT "mini_fo: build_sto_structure: invalid parameter or meta data corruption [2].\n");
    int build_sto_structure(dentry_t *dir, d  
    457460        if(err) {
    458461                printk(KERN_CRIT "mini_fo: build_sto_structure: failed to create storage dir [1].\n");
    459462                /* was: unlock_dir(dir); */
     463#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     464                mutex_unlock(&dir->d_inode->i_mutex);
     465#else
    460466                up(&dir->d_inode->i_sem);
     467#endif
    461468                dput(dir);
    462469                return err;
    463470        }
    int build_sto_structure(dentry_t *dir, d  
    466473        if(!dtohd2(dentry)->d_inode) {
    467474                printk(KERN_CRIT "mini_fo: build_sto_structure: failed to create storage dir [2].\n");
    468475                /* was: unlock_dir(dir); */
     476#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     477                mutex_unlock(&dir->d_inode->i_mutex);
     478#else
    469479                up(&dir->d_inode->i_sem);
     480#endif
    470481                dput(dir);
    471482                return 1;
    472483        }
    int build_sto_structure(dentry_t *dir, d  
    485496                                 hidden_sto_dir_dentry->d_inode);
    486497        dir->d_inode->i_nlink++;
    487498        /* was: unlock_dir(hidden_sto_dir_dentry); */
     499#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     500        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     501#else
    488502        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     503#endif
    489504        dput(hidden_sto_dir_dentry);
    490505        return 0;
    491506}
  • file.c

    a b mini_fo_fsync(file_t *file, dentry_t *de  
    613613        if ((hidden_file = ftohf(file)) != NULL) {
    614614                hidden_dentry = dtohd(dentry);
    615615                if (hidden_file->f_op && hidden_file->f_op->fsync) {
     616#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     617                        mutex_lock(&hidden_dentry->d_inode->i_mutex);
     618#else
    616619                        down(&hidden_dentry->d_inode->i_sem);
     620#endif
    617621                        err1 = hidden_file->f_op->fsync(hidden_file, hidden_dentry, datasync);
     622#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     623                        mutex_unlock(&hidden_dentry->d_inode->i_mutex);
     624#else
    618625                        up(&hidden_dentry->d_inode->i_sem);
     626#endif
    619627                }
    620628        }
    621629
    622630        if ((hidden_file = ftohf2(file)) != NULL) {
    623631                hidden_dentry = dtohd2(dentry);
    624632                if (hidden_file->f_op && hidden_file->f_op->fsync) {
     633#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     634                        mutex_lock(&hidden_dentry->d_inode->i_mutex);
     635#else
    625636                        down(&hidden_dentry->d_inode->i_sem);
     637#endif
    626638                        err2 = hidden_file->f_op->fsync(hidden_file, hidden_dentry, datasync);
     639#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     640                        mutex_unlock(&hidden_dentry->d_inode->i_mutex);
     641#else
    627642                        up(&hidden_dentry->d_inode->i_sem);
     643#endif
    628644                }
    629645        }
    630646        else
  • inode.c

    a b mini_fo_link(dentry_t *old_dentry, inode  
    355355
    356356        /* was: hidden_dir_dentry = lock_parent(hidden_new_dentry); */
    357357        hidden_dir_dentry = dget(hidden_new_dentry->d_parent);
     358#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     359        mutex_lock(&hidden_dir_dentry->d_inode->i_mutex);
     360#else
    358361        down(&hidden_dir_dentry->d_inode->i_sem);
     362#endif
    359363
    360364        err = vfs_link(hidden_old_dentry,
    361365                       hidden_dir_dentry->d_inode,
    mini_fo_link(dentry_t *old_dentry, inode  
    374378
    375379 out_lock:
    376380        /* was: unlock_dir(hidden_dir_dentry); */
     381#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     382        mutex_unlock(&hidden_dir_dentry->d_inode->i_mutex);
     383#else
    377384        up(&hidden_dir_dentry->d_inode->i_sem);
     385#endif
    378386        dput(hidden_dir_dentry);
    379387
    380388        dput(hidden_new_dentry);
    mini_fo_symlink(inode_t *dir, dentry_t *  
    452460        dget(hidden_sto_dentry);
    453461        /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
    454462        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     463#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     464        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     465#else
    455466        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     467#endif
    456468
    457469#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    458470        mode = S_IALLUGO;
    mini_fo_symlink(inode_t *dir, dentry_t *  
    481493       
    482494 out_lock:
    483495        /* was: unlock_dir(hidden_sto_dir_dentry); */
     496#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     497        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     498#else
    484499        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     500#endif
    485501        dput(hidden_sto_dir_dentry);
    486502
    487503        dput(hidden_sto_dentry);
    mini_fo_rmdir(inode_t *dir, dentry_t *de  
    524540
    525541                /* was:hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
    526542                hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     543#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     544                mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     545#else
    527546                down(&hidden_sto_dir_dentry->d_inode->i_sem);
     547#endif
    528548
    529549                /* avoid destroying the hidden inode if the file is in use */
    530550                dget(hidden_sto_dentry);
    mini_fo_rmdir(inode_t *dir, dentry_t *de  
    572592                                         dentry->d_name.len);
    573593                }
    574594                /* was: unlock_dir(hidden_sto_dir_dentry); */
     595#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     596                mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     597#else
    575598                up(&hidden_sto_dir_dentry->d_inode->i_sem);
     599#endif
    576600                dput(hidden_sto_dir_dentry);
    577601                goto out;
    578602        }
    mini_fo_rmdir(inode_t *dir, dentry_t *de  
    602626
    603627                /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry);*/
    604628                hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     629
     630#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     631                mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     632#else
    605633                down(&hidden_sto_dir_dentry->d_inode->i_sem);
     634#endif
    606635
    607636                /* avoid destroying the hidden inode if the file is in use */
    608637                dget(hidden_sto_dentry);
    mini_fo_rmdir(inode_t *dir, dentry_t *de  
    630659                dtopd(dentry)->state = NON_EXISTANT;
    631660
    632661                /* was: unlock_dir(hidden_sto_dir_dentry); */
     662#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     663                mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     664#else
    633665                up(&hidden_sto_dir_dentry->d_inode->i_sem);
     666#endif
    634667                dput(hidden_sto_dir_dentry);
    635668
    636669                goto out;
    mini_fo_rmdir(inode_t *dir, dentry_t *de  
    641674
    642675                /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry);*/
    643676                hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     677
     678#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     679                mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     680#else
    644681                down(&hidden_sto_dir_dentry->d_inode->i_sem);
     682#endif
    645683
    646684                /* avoid destroying the hidden inode if the file is in use */
    647685                dget(hidden_sto_dentry);
    mini_fo_rmdir(inode_t *dir, dentry_t *de  
    668706                dentry->d_inode->i_nlink = itohi2(dentry->d_inode)->i_nlink;
    669707                dtopd(dentry)->state = DELETED;
    670708                /* was: unlock_dir(hidden_sto_dir_dentry); */
     709
     710#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     711                mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     712#else
    671713                up(&hidden_sto_dir_dentry->d_inode->i_sem);
     714#endif
    672715                dput(hidden_sto_dir_dentry);
    673716                goto out;
    674717        }
    mini_fo_getxattr(struct dentry *dentry,  
    12941337                encoded_name = (char *)name;
    12951338                encoded_value = (char *)value;
    12961339
     1340#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1341                mutex_lock(&hidden_dentry->d_inode->i_mutex);
     1342#else
    12971343                down(&hidden_dentry->d_inode->i_sem);
     1344#endif
    12981345                /* lock_kernel() already done by caller. */
    12991346                err = hidden_dentry->d_inode->i_op->getxattr(hidden_dentry, encoded_name, encoded_value, size);
    13001347                /* unlock_kernel() will be done by caller. */
     1348#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1349                mutex_lock(&hidden_dentry->d_inode->i_mutex);
     1350#else
    13011351                up(&hidden_dentry->d_inode->i_sem);
     1352#endif
    13021353        }
    13031354        return err;
    13041355}
    mini_fo_setxattr(struct dentry *dentry,  
    13401391                encoded_name = (char *)name;
    13411392                encoded_value = (char *)value;
    13421393
     1394#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1395                mutex_lock(&hidden_dentry->d_inode->i_mutex);
     1396#else
    13431397                down(&hidden_dentry->d_inode->i_sem);
     1398#endif
    13441399                /* lock_kernel() already done by caller. */
    13451400                err = hidden_dentry->d_inode->i_op->setxattr(hidden_dentry, encoded_name, encoded_value, size, flags);
    13461401                /* unlock_kernel() will be done by caller. */
     1402#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1403                mutex_unlock(&hidden_dentry->d_inode->i_mutex);
     1404#else
    13471405                up(&hidden_dentry->d_inode->i_sem);
     1406#endif
    13481407        }
    13491408        return err;
    13501409}
    mini_fo_removexattr(struct dentry *dentr  
    13721431        if (hidden_dentry->d_inode->i_op->removexattr) {
    13731432                encoded_name = (char *)name;
    13741433
     1434#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1435                mutex_lock(&hidden_dentry->d_inode->i_mutex);
     1436#else
    13751437                down(&hidden_dentry->d_inode->i_sem);
     1438#endif
    13761439                /* lock_kernel() already done by caller. */
    13771440                err = hidden_dentry->d_inode->i_op->removexattr(hidden_dentry, encoded_name);
    13781441                /* unlock_kernel() will be done by caller. */
     1442#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1443                mutex_unlock(&hidden_dentry->d_inode->i_mutex);
     1444#else
    13791445                up(&hidden_dentry->d_inode->i_sem);
     1446#endif
    13801447        }
    13811448        return err;
    13821449}
    mini_fo_listxattr(struct dentry *dentry,  
    14031470
    14041471        if (hidden_dentry->d_inode->i_op->listxattr) {
    14051472                encoded_list = list;
     1473
     1474#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1475                mutex_lock(&hidden_dentry->d_inode->i_mutex);
     1476#else
    14061477                down(&hidden_dentry->d_inode->i_sem);
     1478#endif
    14071479                /* lock_kernel() already done by caller. */
    14081480                err = hidden_dentry->d_inode->i_op->listxattr(hidden_dentry, encoded_list, size);
    14091481                /* unlock_kernel() will be done by caller. */
     1482#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     1483                mutex_unlock(&hidden_dentry->d_inode->i_mutex);
     1484#else
    14101485                up(&hidden_dentry->d_inode->i_sem);
     1486#endif
    14111487        }
    14121488        return err;
    14131489}
  • meta.c

    a b int meta_sync_d_list(dentry_t *dentry, i  
    650650                struct iattr newattrs;
    651651                newattrs.ia_size = 0;
    652652                newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
     653
     654#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     655                mutex_lock(&meta_dentry->d_inode->i_mutex);
     656#else
    653657                down(&meta_dentry->d_inode->i_sem);
     658#endif
    654659                err = notify_change(meta_dentry, &newattrs);
     660
     661#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     662                mutex_unlock(&meta_dentry->d_inode->i_mutex);
     663#else
    655664                up(&meta_dentry->d_inode->i_sem);
     665#endif
     666
    656667                if(err || meta_dentry->d_inode->i_size != 0) {
    657668                        printk(KERN_CRIT "mini_fo: meta_sync_d_list: \
    658669                                          ERROR truncating meta file.\n");
    int meta_sync_r_list(dentry_t *dentry, i  
    780791                struct iattr newattrs;
    781792                newattrs.ia_size = 0;
    782793                newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
     794
     795#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     796                mutex_lock(&meta_dentry->d_inode->i_mutex);
     797#else
    783798                down(&meta_dentry->d_inode->i_sem);
     799#endif
    784800                err = notify_change(meta_dentry, &newattrs);
     801
     802#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     803                mutex_unlock(&meta_dentry->d_inode->i_mutex);
     804#else
    785805                up(&meta_dentry->d_inode->i_sem);
     806#endif
    786807                if(err || meta_dentry->d_inode->i_size != 0) {
    787808                        printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
    788809                                          ERROR truncating meta file.\n");
  • mini_fo.h

    a b fist_copy_attr_all(inode_t *dest, const  
    433433
    434434#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    435435/* copied from linux/fs.h */
     436#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     437static inline void double_lock(struct dentry *d1, struct dentry *d2)
     438{
     439        struct mutex *m1 = &d1->d_inode->i_mutex;
     440        struct mutex *m2 = &d2->d_inode->i_mutex;
     441        if (m1 != m2) {
     442                if ((unsigned long) m1 < (unsigned long) m2) {
     443                        struct mutex *tmp = m2;
     444                        m2 = m1; m1 = tmp;
     445                }
     446                mutex_lock(m1);
     447        }
     448        mutex_lock(m2);
     449}
     450
     451static inline void double_unlock(struct dentry *d1, struct dentry *d2)
     452{
     453        struct mutex *m1 = &d1->d_inode->i_mutex;
     454        struct mutex *m2 = &d2->d_inode->i_mutex;
     455        mutex_unlock(m1);
     456        if (m1 != m2)
     457                mutex_unlock(m2);
     458        dput(d1);
     459        dput(d2);
     460}
     461
     462#else
    436463static inline void double_down(struct semaphore *s1, struct semaphore *s2)
    437464{
    438465        if (s1 != s2) {
    static inline void double_unlock(struct  
    463490        dput(d1);
    464491        dput(d2);
    465492}
    466 
    467 #endif
     493#endif   /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) */
     494#endif  /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */
    468495#endif /* __KERNEL__ */
    469496
    470497/*
  • mmap.c

    a b mini_fo_commit_write(file_t *file, page_  
    478478        if (ftopd(file) != NULL)
    479479                hidden_file = ftohf(file);
    480480
     481#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     482        mutex_lock(&hidden_inode->i_mutex);
     483#else
    481484        down(&hidden_inode->i_sem);
     485#endif
    482486        /* find lower page (returns a locked page) */
    483487        hidden_page = grab_cache_page(hidden_inode->i_mapping, page->index);
    484488        if (!hidden_page)
    mini_fo_commit_write(file_t *file, page_  
    556560                ClearPageUptodate(page);
    557561        else
    558562                SetPageUptodate(page);
     563
     564#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     565        mutex_unlock(&hidden_inode->i_mutex);
     566#else
    559567        up(&hidden_inode->i_sem);
     568#endif
    560569        print_exit_status(err);
    561570        return err;                     /* assume all is ok */
    562571}
  • state.c

    a b int create_sto_reg_file(dentry_t *dentry  
    4444
    4545        /* lock parent */
    4646        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     47
     48#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     49        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     50#else
    4751        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     52#endif
    4853
    4954        err = PTR_ERR(hidden_sto_dir_dentry);
    5055        if (IS_ERR(hidden_sto_dir_dentry))
    int create_sto_reg_file(dentry_t *dentry  
    97102                                 hidden_sto_dir_dentry->d_inode);
    98103
    99104 out_lock:
     105#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     106        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     107#else
    100108        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     109#endif
    101110        dput(hidden_sto_dir_dentry);
    102111 out:
    103112        return err;
    n");  
    130139
    131140        /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
    132141        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     142
     143#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     144        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     145#else
    133146        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     147#endif
    134148
    135149        err = PTR_ERR(hidden_sto_dir_dentry);
    136150        if (IS_ERR(hidden_sto_dir_dentry))
    n");  
    184198
    185199 out_lock:
    186200        /* was: unlock_dir(hidden_sto_dir_dentry); */
     201#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     202        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     203#else
    187204        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     205#endif
    188206        dput(hidden_sto_dir_dentry);
    189207 out:
    190208        return err;
    int create_sto_nod(dentry_t *dentry, int  
    217235       
    218236        /* lock parent */
    219237        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     238
     239#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     240        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     241#else
    220242        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     243#endif
    221244       
    222245        err = PTR_ERR(hidden_sto_dir_dentry);
    223246        if (IS_ERR(hidden_sto_dir_dentry))
    int create_sto_nod(dentry_t *dentry, int  
    260283        fist_copy_attr_timesizes(dir, hidden_sto_dir_dentry->d_inode);
    261284
    262285 out_lock:
     286#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     287        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     288#else
    263289        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     290#endif
    264291        dput(hidden_sto_dir_dentry);
    265292 out:
    266293        return err;
    int nondir_unmod_to_mod(dentry_t *dentry  
    314341
    315342        /* lock parent */
    316343        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     344
     345#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     346        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     347#else
    317348        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     349#endif
    318350
    319351        err = PTR_ERR(hidden_sto_dir_dentry);
    320352        if (IS_ERR(hidden_sto_dir_dentry))
    int nondir_unmod_to_mod(dentry_t *dentry  
    365397        if((cp_flag == 1) && S_ISREG(dentry->d_inode->i_mode)) {
    366398
    367399                /* unlock first */
     400#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     401                mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     402#else
    368403                up(&hidden_sto_dir_dentry->d_inode->i_sem);
     404#endif
     405
    369406                dput(hidden_sto_dir_dentry);
    370407
    371408                tgt_dentry = dtohd2(dentry);
    int nondir_unmod_to_mod(dentry_t *dentry  
    383420        }
    384421
    385422 out_lock:
     423#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     424        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     425#else
    386426        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     427#endif
    387428        dput(hidden_sto_dir_dentry);
    388429 out:
    389430        return err;
    int nondir_creat_to_del(dentry_t *dentry  
    420461       
    421462        /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry);*/
    422463        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     464
     465#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     466        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     467#else
    423468        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     469#endif
    424470       
    425471        /* avoid destroying the hidden inode if the file is in use */
    426472        dget(hidden_sto_dentry);
    int nondir_creat_to_del(dentry_t *dentry  
    435481        dtost(dentry) = NON_EXISTANT;
    436482       
    437483        /* was: unlock_dir(hidden_sto_dir_dentry); */
     484#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     485        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     486#else
    438487        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     488#endif
    439489        dput(hidden_sto_dir_dentry);
    440490       
    441491 out:
    int nondir_mod_to_del(dentry_t *dentry)  
    464514       
    465515        /* was hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
    466516        hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
     517
     518#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     519        mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     520#else
    467521        down(&hidden_sto_dir_dentry->d_inode->i_sem);
     522#endif
    468523       
    469524        /* avoid destroying the hidden inode if the file is in use */
    470525        dget(hidden_sto_dentry);
    int nondir_mod_to_del(dentry_t *dentry)  
    488543                         dentry->d_name.len);
    489544       
    490545        /* was: unlock_dir(hidden_sto_dir_dentry); */
     546#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     547        mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
     548#else
    491549        up(&hidden_sto_dir_dentry->d_inode->i_sem);
     550#endif
    492551        dput(hidden_sto_dir_dentry);
    493552
    494553 out:
Note: See TracBrowser for help on using the repository browser.