char *p = strrchr(bprm->filename, '.');
struct list_head *l;
- for (l = entries.next; l != &entries; l = l->next) {
+ list_for_each(l, &entries) {
Node *e = list_entry(l, Node, list);
char *s;
int j;
{
struct list_head *p;
struct block_device *bdev;
- for (p=head->next; p!=head; p=p->next) {
+ list_for_each(p, head) {
bdev = list_entry(p, struct block_device, bd_hash);
if (bdev->bd_dev != dev)
continue;
{
struct list_head *p;
struct char_device *cdev;
- for (p=head->next; p!=head; p=p->next) {
+ list_for_each(p, head) {
cdev = list_entry(p, struct char_device, hash);
if (cdev->dev != dev)
continue;
* code.
*/
spin_lock(&dcache_lock);
- for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
+ list_for_each(lp, &inode->i_dentry) {
result = list_entry(lp,struct dentry, d_alias);
if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
dget_locked(result);
/* Check that no files are currently opened for writing. */
file_list_lock();
- for (p = sb->s_files.next; p != &sb->s_files; p = p->next) {
+ list_for_each(p, &sb->s_files) {
struct file *file = list_entry(p, struct file, f_list);
struct inode *inode = file->f_dentry->d_inode;
* If possible, get a well-connected one
*/
spin_lock(&dcache_lock);
- for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
+ list_for_each(lp, &inode->i_dentry) {
result = list_entry(lp,struct dentry, d_alias);
if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
dget_locked(result);
* Actually it's a partial revoke().
*/
file_list_lock();
- for (p = sb->s_files.next; p != &sb->s_files; p = p->next) {
+ list_for_each(p, &sb->s_files) {
struct file * filp = list_entry(p, struct file, f_list);
struct dentry * dentry = filp->f_dentry;
struct inode * inode;
* If possible, get a well-connected one
*/
spin_lock(&dcache_lock);
- for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
+ list_for_each(lp, &inode->i_dentry) {
result = list_entry(lp,struct dentry, d_alias);
if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
dget_locked(result);